If you are less in a hurry, you can migrate to @appzung/react-native-code-push
v10+ where we will add new features in the future and actively support the module.
- Replace
react-native-code-push
in your package.json with@appzung/react-native-code-push
:@appzung/react-native-code-push: "^10.0.0"
- Run
npm install
(oryarn
depending on your project)
- Replace every
react-native-code-push
imports with@appzung/react-native-code-push
imports - (optional) As the package is now compatible with ESM, if you call CodePush functions like
CodePush.sync()
or import types/interfaces, you may have to replace your importsimport CodePush from
to selective importsimport withCodePush, { sync, DownloadProgress } from
(orimport * as CodePush from
) - (optional) If you use a jest global mock, move the mock from
__mocks__/react-native-code-push.ts
to__mocks__/@appzung/react-native-code-push.ts
- (optional) If you use dynamic deployment assignation, rename
deploymentKey
option toreleaseChannelPublicId
(TypeScript should catch that)
- Run
bundle exec pod install
- Rename
CodePushDeploymentKey
toCodePushReleaseChannelPublicId
in yourInfo.plist
- (optional) If you already use code signing, rename
CodePushPublicKey
toCodePushSigningPublicKey
in yourInfo.plist
- In
android/settings.gradle
remove the lines about CodePush :include ':react-native-code-push'
andproject(':react-native-code-push').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-code-push/android/app')
- In
android/app/build.gradle
change the line about CodePush:apply from: "../../node_modules/@appzung/react-native-code-push/android/codepush.gradle"
- In your Android files (eg.
MainApplication.kt
), rename everycom.microsoft.codepush
prefix imports withcom.appzung.codepush
- Rename
CodePushDeploymentKey
toCodePushReleaseChannelPublicId
in your strings resources (located either at strings.xml or app/build.gradle). - (optional) If you already use code signing, rename
CodePushPublicKey
toCodePushSigningPublicKey
in your strings resources - (optional) If you used
CodePushBuilder
to instantiate CodePush manually, it has been removed, consider using the standard way or contact us if you really need this - (optional) If you used a custom CodePush
packageInstance
in yourreact-native.config.js
file, it is no longer possible, consider using the standard way or contact us if you really need this