Bare React Native Setup
Wire NitroPush into native iOS and Android release bundle loading.
Bare React Native apps must initialize NitroPush before React Native starts and use the active OTA bundle in release builds.
iOS
- Add
NITROPUSH_DEPLOYMENT_KEYtoInfo.plist. If signing is enabled, also add the completeNITROPUSH_BUNDLE_PUBLIC_KEYvalue printed by the key-generation command. - Import the NitroPush SDK in
AppDelegate.swift. - Return the NitroPush active bundle URL from the release branch of
bundleURL(). - Keep the Metro URL under
#if DEBUG. - Run
cd ios && pod install.
Android
- Add
NITROPUSH_DEPLOYMENT_KEYas<meta-data>inside the application inAndroidManifest.xml. If signing is enabled, addNITROPUSH_BUNDLE_PUBLIC_KEYthere too. - Call
NitroPushSdk.install(this)inMainApplication.onCreate(). - Set the release
jsBundleFilePathfromNitroPushSdk.shared.activeBundleFile(). - Keep that value
nullinBuildConfig.DEBUGso 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.