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-pushin your package.json with@appzung/react-native-code-push:@appzung/react-native-code-push: "^10.0.0" - Run
npm install(oryarndepending on your project)
- Replace every
react-native-code-pushimports with@appzung/react-native-code-pushimports - (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 fromto 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.tsto__mocks__/@appzung/react-native-code-push.ts - (optional) If you use dynamic deployment assignation, rename
deploymentKeyoption toreleaseChannelPublicId(TypeScript should catch that)
- Run
bundle exec pod install - Rename
CodePushDeploymentKeytoCodePushReleaseChannelPublicIdin yourInfo.plist - (optional) If you already use code signing, rename
CodePushPublicKeytoCodePushSigningPublicKeyin yourInfo.plist
- In
android/settings.gradleremove 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')(keepinclude ':app') - In
android/app/build.gradlechange 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.codepushprefix imports withcom.appzung.codepush - Rename
CodePushDeploymentKeytoCodePushReleaseChannelPublicIdin your strings resources (located either at strings.xml or app/build.gradle). - (optional) If you already use code signing, rename
CodePushPublicKeytoCodePushSigningPublicKeyin your strings resources - (optional) If you used
CodePushBuilderto 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
packageInstancein yourreact-native.config.jsfile, it is no longer possible, consider using the standard way or contact us if you really need this