Bare React Native Setup

Wire NitroPush into native iOS and Android release bundle loading.

Edit

Bare React Native apps must initialize NitroPush before React Native starts and use the active OTA bundle in release builds.

iOS

  1. Add NITROPUSH_DEPLOYMENT_KEY to Info.plist. If signing is enabled, also add the complete NITROPUSH_BUNDLE_PUBLIC_KEY value printed by the key-generation command.
  2. Import the NitroPush SDK in AppDelegate.swift.
  3. Return the NitroPush active bundle URL from the release branch of bundleURL().
  4. Keep the Metro URL under #if DEBUG.
  5. Run cd ios && pod install.

Android

  1. Add NITROPUSH_DEPLOYMENT_KEY as <meta-data> inside the application in AndroidManifest.xml. If signing is enabled, add NITROPUSH_BUNDLE_PUBLIC_KEY there too.
  2. Call NitroPushSdk.install(this) in MainApplication.onCreate().
  3. Set the release jsBundleFilePath from NitroPushSdk.shared.activeBundleFile().
  4. Keep that value null in BuildConfig.DEBUG so Metro remains active.

Native rebuild required

Deployment key and bundle-loader changes are compiled into the binary. Rebuild and reinstall the app before testing.

Then add the JavaScript lifecycle.

On this page