@algocare/react-native-code-push 12.6.4 → 13.0.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CodePush.podspec +6 -8
- package/README.md +343 -586
- package/android/app/build.gradle +2 -1
- package/android/app/proguard-rules.pro +14 -0
- package/android/app/src/debug/AndroidManifest.xml +9 -0
- package/android/app/src/main/AndroidManifest.xml +1 -2
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePush.java +14 -139
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushConstants.java +0 -3
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushNativeModule.java +108 -63
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushUpdateManager.java +2 -33
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushUpdateUtils.java +13 -109
- package/android/build.gradle +3 -0
- package/app.plugin.js +1 -0
- package/bin/code-push.js +6 -0
- package/cli/commands/bundleCommand/bundleCodePush.ts +118 -0
- package/cli/commands/bundleCommand/index.ts +34 -0
- package/cli/commands/createHistoryCommand/createReleaseHistory.ts +37 -0
- package/cli/commands/createHistoryCommand/createReleaseHistoryList.ts +40 -0
- package/cli/commands/createHistoryCommand/index.ts +44 -0
- package/cli/commands/createPullRequestHistoryCommand/createPullRequestHistory.ts +33 -0
- package/cli/commands/createPullRequestHistoryCommand/index.ts +31 -0
- package/cli/commands/createPullRequestReleaseCommand/addToPullRequestRelease.ts +71 -0
- package/cli/commands/createPullRequestReleaseCommand/createPullRequestRelease.ts +75 -0
- package/cli/commands/createPullRequestReleaseCommand/index.ts +74 -0
- package/cli/commands/getPackageHashCommand/index.ts +45 -0
- package/cli/commands/initCommand/index.ts +14 -0
- package/cli/commands/initCommand/initAndroid.ts +91 -0
- package/cli/commands/initCommand/initIos.ts +123 -0
- package/cli/commands/initCommand/test/initAndroid.test.ts +128 -0
- package/cli/commands/initCommand/test/initIos.test.ts +99 -0
- package/cli/commands/releaseCommand/addToReleaseHistory.ts +57 -0
- package/cli/commands/releaseCommand/index.ts +90 -0
- package/cli/commands/releaseCommand/release.ts +105 -0
- package/cli/commands/removePullRequestHistoryCommand/index.ts +37 -0
- package/cli/commands/removePullRequestHistoryCommand/removePullRequestHistory.ts +28 -0
- package/cli/commands/showHistoryCommand/index.ts +31 -0
- package/cli/commands/updateHistoryCommand/index.ts +55 -0
- package/cli/commands/updateHistoryCommand/updateReleaseHistory.ts +42 -0
- package/cli/constant.ts +4 -0
- package/cli/dist/commands/bundleCommand/bundleCodePush.js +65 -0
- package/cli/dist/commands/bundleCommand/index.js +15 -0
- package/cli/dist/commands/createHistoryCommand/createReleaseHistory.js +25 -0
- package/cli/dist/commands/createHistoryCommand/createReleaseHistoryList.js +27 -0
- package/cli/dist/commands/createHistoryCommand/index.js +20 -0
- package/cli/dist/commands/createPullRequestHistoryCommand/createPullRequestHistory.js +23 -0
- package/cli/dist/commands/createPullRequestHistoryCommand/index.js +15 -0
- package/cli/dist/commands/createPullRequestReleaseCommand/addToPullRequestRelease.js +51 -0
- package/cli/dist/commands/createPullRequestReleaseCommand/createPullRequestRelease.js +39 -0
- package/cli/dist/commands/createPullRequestReleaseCommand/index.js +35 -0
- package/cli/dist/commands/getPackageHashCommand/index.js +26 -0
- package/cli/dist/commands/initCommand/index.js +12 -0
- package/cli/dist/commands/initCommand/initAndroid.js +73 -0
- package/cli/dist/commands/initCommand/initIos.js +108 -0
- package/cli/dist/commands/initCommand/test/initAndroid.test.js +113 -0
- package/cli/dist/commands/initCommand/test/initIos.test.js +95 -0
- package/cli/dist/commands/releaseCommand/addToReleaseHistory.js +35 -0
- package/cli/dist/commands/releaseCommand/index.js +45 -0
- package/cli/dist/commands/releaseCommand/release.js +62 -0
- package/cli/dist/commands/removePullRequestHistoryCommand/index.js +19 -0
- package/cli/dist/commands/removePullRequestHistoryCommand/removePullRequestHistory.js +18 -0
- package/cli/dist/commands/showHistoryCommand/index.js +15 -0
- package/cli/dist/commands/updateHistoryCommand/index.js +31 -0
- package/cli/dist/commands/updateHistoryCommand/updateReleaseHistory.js +28 -0
- package/cli/dist/constant.js +4 -0
- package/cli/dist/functions/getReactTempDir.js +10 -0
- package/cli/{functions → dist/functions}/makeCodePushBundle.js +5 -11
- package/cli/{functions → dist/functions}/prepareToBundleJS.js +2 -5
- package/cli/dist/functions/runExpoBundleCommand.js +35 -0
- package/cli/{functions → dist/functions}/runHermesEmitBinaryCommand.js +36 -71
- package/cli/{functions → dist/functions}/runReactNativeBundleCommand.js +19 -24
- package/cli/dist/index.js +54 -0
- package/cli/dist/utils/datetime.js +17 -0
- package/cli/dist/utils/file-utils.js +19 -0
- package/cli/dist/utils/fsUtils.js +44 -0
- package/cli/{utils → dist/utils}/hash-utils.js +19 -130
- package/cli/{utils → dist/utils}/promisfied-fs.js +5 -16
- package/cli/dist/utils/showLogo.js +21 -0
- package/cli/dist/utils/unzip.js +41 -0
- package/cli/{utils → dist/utils}/zip.js +15 -51
- package/cli/functions/{getReactTempDir.js → getReactTempDir.ts} +2 -6
- package/cli/functions/makeCodePushBundle.ts +26 -0
- package/cli/functions/prepareToBundleJS.ts +10 -0
- package/cli/functions/runExpoBundleCommand.ts +45 -0
- package/cli/functions/runHermesEmitBinaryCommand.ts +203 -0
- package/cli/functions/runReactNativeBundleCommand.ts +67 -0
- package/cli/index.ts +68 -0
- package/cli/package.json +35 -0
- package/cli/utils/datetime.ts +19 -0
- package/cli/utils/{file-utils.js → file-utils.ts} +4 -21
- package/cli/utils/fsUtils.ts +50 -0
- package/cli/utils/hash-utils.ts +143 -0
- package/cli/utils/promisfied-fs.ts +19 -0
- package/cli/utils/{showLogo.js → showLogo.ts} +4 -6
- package/cli/utils/unzip.ts +46 -0
- package/cli/utils/zip.ts +65 -0
- package/expo/plugin/withCodePush.js +14 -0
- package/expo/plugin/withCodePushAndroid.js +92 -0
- package/expo/plugin/withCodePushIos.js +143 -0
- package/ios/CodePush/CodePush.h +0 -16
- package/ios/CodePush/CodePush.m +30 -20
- package/ios/CodePush/CodePushConfig.m +1 -11
- package/ios/CodePush/CodePushPackage.m +12 -69
- package/ios/CodePush/CodePushUpdateUtils.m +1 -91
- package/ios/CodePush/SSZipArchive/Info.plist +26 -0
- package/ios/CodePush/SSZipArchive/README.md +1 -1
- package/ios/CodePush/SSZipArchive/SSZipArchive.h +129 -27
- package/ios/CodePush/SSZipArchive/SSZipArchive.m +1119 -314
- package/ios/CodePush/SSZipArchive/SSZipCommon.h +71 -0
- package/ios/CodePush/SSZipArchive/Supporting Files/PrivacyInfo.xcprivacy +23 -0
- package/ios/CodePush/SSZipArchive/include/ZipArchive.h +25 -0
- package/ios/CodePush/SSZipArchive/minizip/LICENSE +17 -0
- package/ios/CodePush/SSZipArchive/minizip/mz.h +273 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_compat.c +1306 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_compat.h +346 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_crypt.c +187 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_crypt.h +65 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_crypt_apple.c +526 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_os.c +348 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_os.h +176 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_os_posix.c +350 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm.c +556 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm.h +132 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_buf.c +383 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_buf.h +42 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_mem.c +269 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_mem.h +48 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_os.h +40 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_os_posix.c +203 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_pkcrypt.c +334 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_pkcrypt.h +46 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_split.c +429 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_split.h +43 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_wzaes.c +360 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_wzaes.h +46 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_zlib.c +389 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_zlib.h +43 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_zip.c +2782 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_zip.h +262 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_zip_rw.c +1942 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_zip_rw.h +285 -0
- package/ios/CodePush.xcodeproj/project.pbxproj +244 -453
- package/ios/PrivacyInfo.xcprivacy +31 -0
- package/package.json +68 -42
- package/react-native.config.js +1 -1
- package/{AlertAdapter.js → src/AlertAdapter.js} +5 -5
- package/src/CodePush.js +947 -0
- package/{package-mixins.js → src/package-mixins.js} +1 -1
- package/{versioning → src/versioning}/BaseVersioning.js +12 -1
- package/{versioning → src/versioning}/SemverVersioning.test.js +78 -0
- package/typings/react-native-code-push.d.ts +559 -495
- package/.claude/commands/release.md +0 -78
- package/.claude/skills/npm-release/SKILL.md +0 -89
- package/CLAUDE.md +0 -83
- package/CONTRIBUTING.md +0 -134
- package/CodePush.js +0 -972
- package/SECURITY.md +0 -41
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushBuilder.java +0 -37
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushInvalidPublicKeyException.java +0 -12
- package/android/app/src/main/java/com/microsoft/codepush/react/ReactInstanceHolder.java +0 -17
- package/android/codepush.gradle +0 -162
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +0 -5
- package/android/gradlew +0 -164
- package/android/gradlew.bat +0 -90
- package/babel.config.js +0 -3
- package/cli/commands/bundleCommand/bundleCodePush.js +0 -57
- package/cli/commands/bundleCommand/index.js +0 -55
- package/cli/commands/common.js +0 -245
- package/cli/commands/createHistoryCommand/createReleaseHistory.js +0 -42
- package/cli/commands/createHistoryCommand/createReleaseHistoryList.js +0 -52
- package/cli/commands/createHistoryCommand/index.js +0 -95
- package/cli/commands/createPullRequestHistoryCommand/createPullRequestHistory.js +0 -34
- package/cli/commands/createPullRequestHistoryCommand/index.js +0 -29
- package/cli/commands/createPullRequestReleaseCommand/addToPullRequestRelease.js +0 -74
- package/cli/commands/createPullRequestReleaseCommand/createPullRequestRelease.js +0 -91
- package/cli/commands/createPullRequestReleaseCommand/index.js +0 -68
- package/cli/commands/getPackageHashCommand/index.js +0 -42
- package/cli/commands/releaseCommand/addToReleaseHistory.js +0 -85
- package/cli/commands/releaseCommand/index.js +0 -151
- package/cli/commands/releaseCommand/release.js +0 -121
- package/cli/commands/removePullRequestHistoryCommand/index.js +0 -28
- package/cli/commands/removePullRequestHistoryCommand/removePullRequestHistory.js +0 -23
- package/cli/commands/showHistoryCommand/index.js +0 -88
- package/cli/commands/updateHistoryCommand/index.js +0 -123
- package/cli/commands/updateHistoryCommand/updateReleaseHistory.js +0 -69
- package/cli/constant.js +0 -8
- package/cli/index.js +0 -63
- package/cli/utils/datetime.js +0 -22
- package/cli/utils/fsUtils.js +0 -64
- package/cli/utils/version.js +0 -26
- package/code-push.config.example.supabase.ts +0 -114
- package/code-push.config.js +0 -229
- package/code-push.config.ts +0 -175
- package/docs/api-android.md +0 -83
- package/docs/api-ios.md +0 -31
- package/docs/api-js.md +0 -592
- package/docs/multi-deployment-testing-android.md +0 -148
- package/docs/multi-deployment-testing-ios.md +0 -59
- package/docs/setup-android.md +0 -482
- package/docs/setup-ios.md +0 -280
- package/eslint.config.mjs +0 -32
- package/ios/CodePush/Base64/Base64/MF_Base64Additions.h +0 -34
- package/ios/CodePush/Base64/Base64/MF_Base64Additions.m +0 -252
- package/ios/CodePush/Base64/README.md +0 -47
- package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithm.h +0 -69
- package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmFactory.h +0 -16
- package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmFactory.m +0 -51
- package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmNone.h +0 -15
- package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmNone.m +0 -55
- package/ios/CodePush/JWT/Core/Algorithms/ESFamily/JWTAlgorithmESBase.h +0 -24
- package/ios/CodePush/JWT/Core/Algorithms/ESFamily/JWTAlgorithmESBase.m +0 -41
- package/ios/CodePush/JWT/Core/Algorithms/HSFamily/JWTAlgorithmHSBase.h +0 -28
- package/ios/CodePush/JWT/Core/Algorithms/HSFamily/JWTAlgorithmHSBase.m +0 -205
- package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolder.h +0 -103
- package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolder.m +0 -322
- package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolderChain.h +0 -37
- package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolderChain.m +0 -145
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/JWTAlgorithmRSBase.h +0 -35
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/JWTAlgorithmRSBase.m +0 -551
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/JWTRSAlgorithm.h +0 -23
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKey.h +0 -43
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKey.m +0 -230
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKeyExtractor.h +0 -31
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKeyExtractor.m +0 -113
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoSecurity.h +0 -38
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoSecurity.m +0 -500
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaim.h +0 -18
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaim.m +0 -214
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSet.h +0 -23
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSet.m +0 -29
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetSerializer.h +0 -19
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetSerializer.m +0 -68
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetVerifier.h +0 -18
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetVerifier.m +0 -72
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+ResultTypes.h +0 -67
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+ResultTypes.m +0 -111
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionOne.h +0 -119
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionOne.m +0 -307
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionThree.h +0 -94
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionThree.m +0 -619
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionTwo.h +0 -164
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionTwo.m +0 -514
- package/ios/CodePush/JWT/Core/Coding/JWTCoding.h +0 -24
- package/ios/CodePush/JWT/Core/Coding/JWTCoding.m +0 -11
- package/ios/CodePush/JWT/Core/FrameworkSupplement/JWT.h +0 -52
- package/ios/CodePush/JWT/Core/FrameworkSupplement/Map.modulemap +0 -5
- package/ios/CodePush/JWT/Core/Supplement/JWTBase64Coder.h +0 -28
- package/ios/CodePush/JWT/Core/Supplement/JWTBase64Coder.m +0 -70
- package/ios/CodePush/JWT/Core/Supplement/JWTDeprecations.h +0 -22
- package/ios/CodePush/JWT/Core/Supplement/JWTErrorDescription.h +0 -34
- package/ios/CodePush/JWT/Core/Supplement/JWTErrorDescription.m +0 -73
- package/ios/CodePush/JWT/LICENSE +0 -19
- package/ios/CodePush/JWT/README.md +0 -489
- package/ios/CodePush/SSZipArchive/Common.h +0 -81
- package/ios/CodePush/SSZipArchive/aes/aes.h +0 -198
- package/ios/CodePush/SSZipArchive/aes/aes_via_ace.h +0 -541
- package/ios/CodePush/SSZipArchive/aes/aescrypt.c +0 -294
- package/ios/CodePush/SSZipArchive/aes/aeskey.c +0 -548
- package/ios/CodePush/SSZipArchive/aes/aesopt.h +0 -739
- package/ios/CodePush/SSZipArchive/aes/aestab.c +0 -391
- package/ios/CodePush/SSZipArchive/aes/aestab.h +0 -173
- package/ios/CodePush/SSZipArchive/aes/brg_endian.h +0 -126
- package/ios/CodePush/SSZipArchive/aes/brg_types.h +0 -219
- package/ios/CodePush/SSZipArchive/aes/entropy.c +0 -54
- package/ios/CodePush/SSZipArchive/aes/entropy.h +0 -16
- package/ios/CodePush/SSZipArchive/aes/fileenc.c +0 -144
- package/ios/CodePush/SSZipArchive/aes/fileenc.h +0 -121
- package/ios/CodePush/SSZipArchive/aes/hmac.c +0 -145
- package/ios/CodePush/SSZipArchive/aes/hmac.h +0 -103
- package/ios/CodePush/SSZipArchive/aes/prng.c +0 -155
- package/ios/CodePush/SSZipArchive/aes/prng.h +0 -82
- package/ios/CodePush/SSZipArchive/aes/pwd2key.c +0 -103
- package/ios/CodePush/SSZipArchive/aes/pwd2key.h +0 -57
- package/ios/CodePush/SSZipArchive/aes/sha1.c +0 -258
- package/ios/CodePush/SSZipArchive/aes/sha1.h +0 -73
- package/ios/CodePush/SSZipArchive/minizip/crypt.h +0 -130
- package/ios/CodePush/SSZipArchive/minizip/ioapi.c +0 -369
- package/ios/CodePush/SSZipArchive/minizip/ioapi.h +0 -175
- package/ios/CodePush/SSZipArchive/minizip/mztools.c +0 -284
- package/ios/CodePush/SSZipArchive/minizip/mztools.h +0 -31
- package/ios/CodePush/SSZipArchive/minizip/unzip.c +0 -1839
- package/ios/CodePush/SSZipArchive/minizip/unzip.h +0 -248
- package/ios/CodePush/SSZipArchive/minizip/zip.c +0 -1910
- package/ios/CodePush/SSZipArchive/minizip/zip.h +0 -202
- package/scripts/generateBundledResourcesHash.js +0 -125
- package/scripts/getFilesInFolder.js +0 -19
- package/scripts/recordFilesBeforeBundleCommand.js +0 -41
- package/scripts/release.sh +0 -86
- package/tsconfig.json +0 -20
- package/tslint.json +0 -32
- /package/{logging.js → src/logging.js} +0 -0
- /package/{versioning → src/versioning}/BaseVersioning.test.js +0 -0
- /package/{versioning → src/versioning}/IncrementalVersioning.js +0 -0
- /package/{versioning → src/versioning}/IncrementalVersioning.test.js +0 -0
- /package/{versioning → src/versioning}/SemverVersioning.js +0 -0
- /package/{versioning → src/versioning}/index.js +0 -0
package/README.md
CHANGED
|
@@ -1,738 +1,495 @@
|
|
|
1
|
-
|
|
1
|
+
# @algocare/react-native-code-push
|
|
2
2
|
|
|
3
|
-
>
|
|
4
|
-
> AppCenter 없이 독립적인 CodePush 배포 시스템
|
|
3
|
+
> **알고케어 포크 (v13+)** — [Soomgo-Mobile/react-native-code-push](https://github.com/Soomgo-Mobile/react-native-code-push) v12.4.0 베이스. 12.6.x에서 올라오는 경우 [docs/migration-v13.ko.md](./docs/migration-v13.ko.md) 필독.
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
npm install @algocare/react-native-code-push
|
|
8
|
-
```
|
|
9
|
-
|
|
10
|
-
---
|
|
5
|
+
### Seamless Transition from AppCenter to a Fully Self-Hosted CodePush
|
|
11
6
|
|
|
12
|
-
|
|
7
|
+
- **No API Server Needed** – Use static hosting solutions (e.g., AWS S3) without maintaining additional API servers.
|
|
8
|
+
- **Familiar API** – Built on `microsoft/react-native-code-push`, ensuring compatibility and stability.
|
|
9
|
+
- **Flexible Deployment** – Implement your own release workflow, giving you complete control over the deployment process.
|
|
13
10
|
|
|
14
|
-
###
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
npm install @algocare/react-native-code-push
|
|
18
|
-
```
|
|
11
|
+
### 🚀 New Architecture support
|
|
19
12
|
|
|
20
|
-
|
|
13
|
+
Supports React Native 0.77 ~ 0.84.
|
|
21
14
|
|
|
22
|
-
|
|
15
|
+
> [!NOTE]
|
|
16
|
+
> If you are using React Native 0.76 or lower, please use version `12.0.2` of this library.
|
|
23
17
|
|
|
24
|
-
|
|
18
|
+
(Tested on the React Native CLI template apps)
|
|
25
19
|
|
|
26
|
-
|
|
27
|
-
# AWS 자격 증명
|
|
28
|
-
AWS_ACCESS_KEY_ID=your_aws_access_key_here
|
|
29
|
-
AWS_SECRET_ACCESS_KEY=your_aws_secret_key_here
|
|
30
|
-
AWS_REGION=ap-northeast-2
|
|
31
|
-
|
|
32
|
-
# STG/PRD 환경별 설정
|
|
33
|
-
AWS_S3_BUCKET_STG=your-stg-bucket-name
|
|
34
|
-
AWS_S3_BUCKET_PRD=your-prd-bucket-name
|
|
35
|
-
CDN_URL_STG=https://your-stg-cdn-url.com
|
|
36
|
-
CDN_URL_PRD=https://your-prd-cdn-url.com
|
|
37
|
-
```
|
|
20
|
+
### ✅ Requirements
|
|
38
21
|
|
|
39
|
-
|
|
22
|
+
- **React Native**: 0.77 or higher
|
|
23
|
+
- **iOS**: 15.5 or higher
|
|
24
|
+
- **Android**: API level 16 or higher
|
|
40
25
|
|
|
41
|
-
|
|
26
|
+
## 🚗 Migration Guide
|
|
42
27
|
|
|
43
|
-
|
|
28
|
+
If you have been using `react-native-code-push`, replace the NPM package first.
|
|
44
29
|
|
|
45
30
|
```bash
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
yarn set:prd # PRD 환경변수 로드
|
|
31
|
+
npm remove react-native-code-push
|
|
32
|
+
npm install @bravemobile/react-native-code-push
|
|
49
33
|
```
|
|
50
34
|
|
|
51
|
-
|
|
35
|
+
1. Edit `android/app/build.gradle` file to remove the `apply from: "../../node_modules/..../codepush.gradle"` line.
|
|
52
36
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
echo ".env" >> .gitignore
|
|
57
|
-
```
|
|
37
|
+
2. The following changes are optional but recommended for cleaning up the old configuration:
|
|
38
|
+
- Since the deployment key is no longer needed due to the retirement of AppCenter, it is recommended to remove it from your `Info.plist`, `strings.xml`, or JavaScript code.
|
|
39
|
+
- Thanks to Auto Linking, you can remove the `react-native-code-push` module settings from `settings.gradle`.
|
|
58
40
|
|
|
59
|
-
|
|
41
|
+
3. Follow the installation guide starting from **'4. "CodePush-ify" your app'**.
|
|
60
42
|
|
|
61
|
-
```json
|
|
62
|
-
{
|
|
63
|
-
"scripts": {
|
|
64
|
-
"codepush:release": "sh scripts/codepush.sh release",
|
|
65
|
-
"codepush:release:prd": "sh scripts/codepush.sh release --env=prd",
|
|
66
|
-
"codepush:show": "sh scripts/codepush.sh show",
|
|
67
|
-
"codepush:show:prd": "sh scripts/codepush.sh show --env=prd"
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
```
|
|
71
43
|
|
|
72
|
-
|
|
44
|
+
## ⚙️ Installation
|
|
73
45
|
|
|
46
|
+
### 1. Install NPM Package
|
|
74
47
|
```bash
|
|
75
|
-
|
|
76
|
-
npm run codepush:release
|
|
77
|
-
|
|
78
|
-
# Production 환경에 배포
|
|
79
|
-
npm run codepush:release:prd
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
**끝!** 더 이상 추가 설정 파일이 필요 없습니다. 🎉
|
|
83
|
-
|
|
84
|
-
---
|
|
85
|
-
|
|
86
|
-
## 📱 지원하는 앱
|
|
87
|
-
|
|
88
|
-
| 앱 이름 | 설명 | 플랫폼 | 환경 관리 |
|
|
89
|
-
|---------|------|--------|----------|
|
|
90
|
-
| `user` | B2B 모바일 앱 | iOS, Android | Infisical (STG/PRD) |
|
|
91
|
-
| `device` | B2B 디바이스 앱 | Android | Infisical (STG/PRD) |
|
|
92
|
-
| `b2c-device` | B2C MVP 디바이스 앱 | Android | Infisical (STG/PRD) |
|
|
93
|
-
| `home-device` | B2C Home (상용) 디바이스 앱 | Android | .env 파일 (STG/PRD) |
|
|
94
|
-
| `home-mobile` | B2C Home (상용) 모바일 앱 | iOS, Android | .env 파일 (STG/PRD) |
|
|
95
|
-
|
|
96
|
-
> **모든 앱이 STG/PRD 환경을 구분합니다!**
|
|
97
|
-
> - **B2B + B2C MVP**: Infisical로 환경변수 관리
|
|
98
|
-
> - **B2C Home**: .env 파일로 환경변수 관리
|
|
99
|
-
|
|
100
|
-
---
|
|
101
|
-
|
|
102
|
-
## ⚙️ 작동 원리
|
|
103
|
-
|
|
104
|
-
### 환경 자동 선택
|
|
105
|
-
|
|
106
|
-
패키지가 자동으로 다음을 수행합니다:
|
|
107
|
-
|
|
108
|
-
1. `.env` 파일에서 AWS 자격증명 로드
|
|
109
|
-
2. `-i` 플래그로 환경 구분 (stg/prd)
|
|
110
|
-
3. 적절한 S3 버킷과 CDN URL 선택
|
|
111
|
-
4. 번들을 업로드하고 히스토리 관리
|
|
112
|
-
|
|
113
|
-
### 환경변수 우선순위
|
|
114
|
-
|
|
115
|
-
```javascript
|
|
116
|
-
// STG 환경
|
|
117
|
-
-i stg → AWS_S3_BUCKET_STG, CDN_URL_STG
|
|
118
|
-
|
|
119
|
-
// PRD 환경
|
|
120
|
-
-i prd → AWS_S3_BUCKET_PRD, CDN_URL_PRD
|
|
121
|
-
|
|
122
|
-
// 레거시 호환성 (옵션)
|
|
123
|
-
AWS_S3_BUCKET, CDN_URL // identifier 없이 사용 가능
|
|
48
|
+
npm install @bravemobile/react-native-code-push
|
|
124
49
|
```
|
|
125
50
|
|
|
126
|
-
|
|
51
|
+
### 2. Run init command
|
|
127
52
|
|
|
128
|
-
|
|
53
|
+
For React Native CLI projects, you can use the automatic setup command to configure your project for CodePush.
|
|
129
54
|
|
|
130
|
-
|
|
55
|
+
This command will automatically edit your `AppDelegate` and `MainApplication` files to integrate CodePush.
|
|
131
56
|
|
|
132
|
-
**home-device, home-mobile**
|
|
133
|
-
|
|
134
|
-
`.env` 파일:
|
|
135
57
|
```bash
|
|
136
|
-
|
|
137
|
-
AWS_S3_BUCKET_PRD=your-prd-bucket-name
|
|
138
|
-
CDN_URL_STG=https://your-stg-cdn-url.com
|
|
139
|
-
CDN_URL_PRD=https://your-prd-cdn-url.com
|
|
58
|
+
npx code-push init
|
|
140
59
|
```
|
|
141
60
|
|
|
142
|
-
|
|
143
|
-
```bash
|
|
144
|
-
npm run codepush:release # STG 배포
|
|
145
|
-
npm run codepush:release:prd # PRD 배포
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
### B2B + B2C MVP (Infisical)
|
|
149
|
-
|
|
150
|
-
**user, device, b2c-device**
|
|
61
|
+
And run the following command to install CocoaPods dependencies for iOS:
|
|
151
62
|
|
|
152
63
|
```bash
|
|
153
|
-
|
|
154
|
-
{
|
|
155
|
-
"scripts": {
|
|
156
|
-
"set:stg": "infisical export --env=stg > .env",
|
|
157
|
-
"set:prd": "infisical export --env=prd > .env",
|
|
158
|
-
"codepush:stg": "yarn set:stg && npx code-push release -i stg",
|
|
159
|
-
"codepush:prd": "yarn set:prd && npx code-push release -i prd"
|
|
160
|
-
}
|
|
161
|
-
}
|
|
64
|
+
cd ios && pod install && cd ..
|
|
162
65
|
```
|
|
66
|
+
(or `npx pod-install`, `bundle exec pod install --project-directory=./ios`, ..)
|
|
163
67
|
|
|
164
|
-
|
|
165
|
-
```bash
|
|
166
|
-
yarn codepush:stg # STG 배포
|
|
167
|
-
yarn codepush:prd # PRD 배포
|
|
168
|
-
```
|
|
68
|
+
### 2-1. Manual Setup
|
|
169
69
|
|
|
170
|
-
|
|
70
|
+
If you prefer manual setup or if the automatic configuration fails, you can follow the manual setup instructions below.
|
|
171
71
|
|
|
172
|
-
|
|
72
|
+
<details><summary>Click to see the manual setup instructions.</summary>
|
|
73
|
+
<p>
|
|
173
74
|
|
|
174
|
-
###
|
|
75
|
+
### iOS Manual Setup
|
|
175
76
|
|
|
176
|
-
|
|
177
|
-
#!/bin/bash
|
|
178
|
-
|
|
179
|
-
ENV="stg"
|
|
180
|
-
COMMAND=""
|
|
181
|
-
ADDITIONAL_ARGS="-a home-mobile -i $ENV"
|
|
182
|
-
|
|
183
|
-
while [[ "$#" -gt 0 ]]; do
|
|
184
|
-
case $1 in
|
|
185
|
-
create|update|show|release) COMMAND="$1";;
|
|
186
|
-
--env=*) ENV="${1#*=}"
|
|
187
|
-
ADDITIONAL_ARGS="-a home-mobile -i $ENV"
|
|
188
|
-
;;
|
|
189
|
-
*) ADDITIONAL_ARGS="$ADDITIONAL_ARGS $1";;
|
|
190
|
-
esac
|
|
191
|
-
shift
|
|
192
|
-
done
|
|
193
|
-
|
|
194
|
-
if [ "$COMMAND" = "release" ]; then
|
|
195
|
-
npx code-push release $ADDITIONAL_ARGS
|
|
196
|
-
else
|
|
197
|
-
npx code-push $COMMAND-history $ADDITIONAL_ARGS
|
|
198
|
-
fi
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
---
|
|
77
|
+
#### (1) Install CocoaPods Dependencies
|
|
202
78
|
|
|
203
|
-
|
|
79
|
+
Run `cd ios && pod install && cd ..`
|
|
204
80
|
|
|
205
|
-
|
|
81
|
+
(`npx pod-install`, `bundle exec pod install --project-directory=./ios`, ..)
|
|
206
82
|
|
|
207
|
-
1. 프로젝트마다 `code-push.config.js` 파일 생성
|
|
208
|
-
2. AWS 키 하드코딩 (보안 위험)
|
|
209
|
-
3. `postinstall` 스크립트로 파일 복사
|
|
210
|
-
4. 환경별로 다른 설정 파일 관리
|
|
211
83
|
|
|
212
|
-
|
|
84
|
+
#### (2) Edit `AppDelegate` Code
|
|
213
85
|
|
|
214
|
-
|
|
215
|
-
2. AWS 키 안전하게 관리
|
|
216
|
-
3. 추가 설정 파일 불필요
|
|
217
|
-
4. 환경변수로 자동 전환
|
|
86
|
+
**If you have `AppDelegate.swift` (>= RN 0.77)**
|
|
218
87
|
|
|
219
|
-
---
|
|
220
88
|
|
|
221
|
-
|
|
89
|
+
<details><summary>If your project doesn't have bridging header, please create a file.</summary>
|
|
90
|
+
<p>
|
|
222
91
|
|
|
223
|
-
|
|
92
|
+
1. Open your project with Xcode (e.g. CodePushDemoApp.xcworkspace)
|
|
93
|
+
2. File → New → File from Template
|
|
94
|
+
3. Select 'Objective-C File' and click 'Next' and write any name as you like.
|
|
95
|
+
4. Then Xcode will ask you to create a bridging header file. Click 'Create'.
|
|
96
|
+
5. Delete the file created in step 3.
|
|
224
97
|
|
|
225
|
-
|
|
98
|
+
</p>
|
|
99
|
+
</details>
|
|
226
100
|
|
|
227
|
-
**해결**:
|
|
228
|
-
```bash
|
|
229
|
-
# .env 파일 확인
|
|
230
|
-
cat .env
|
|
231
101
|
|
|
232
|
-
|
|
233
|
-
|
|
102
|
+
Add the following line to the bridging header file. (e.g. `CodePushDemoApp-Bridging-Header.h`)
|
|
103
|
+
```diff
|
|
104
|
+
+ #import <CodePush/CodePush.h>
|
|
234
105
|
```
|
|
235
106
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
npm run codepush:release:prd # -i prd
|
|
107
|
+
Then, edit `AppDelegate.swift` like below.
|
|
108
|
+
|
|
109
|
+
```diff
|
|
110
|
+
@main
|
|
111
|
+
class AppDelegate: RCTAppDelegate {
|
|
112
|
+
override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
|
|
113
|
+
|
|
114
|
+
// ...
|
|
115
|
+
|
|
116
|
+
override func bundleURL() -> URL? {
|
|
117
|
+
#if DEBUG
|
|
118
|
+
RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index")
|
|
119
|
+
#else
|
|
120
|
+
- Bundle.main.url(forResource: "main", withExtension: "jsbundle")
|
|
121
|
+
+ CodePush.bundleURL()
|
|
122
|
+
#endif
|
|
123
|
+
}
|
|
124
|
+
}
|
|
255
125
|
```
|
|
256
126
|
|
|
257
|
-
---
|
|
258
|
-
|
|
259
|
-
### Self-host the update bundle file
|
|
260
127
|
|
|
261
|
-
|
|
128
|
+
**Or if you have `AppDelegate.mm`**
|
|
129
|
+
|
|
130
|
+
```diff
|
|
131
|
+
+ #import <CodePush/CodePush.h>
|
|
132
|
+
|
|
133
|
+
// ...
|
|
134
|
+
|
|
135
|
+
- (NSURL *)bundleURL
|
|
136
|
+
{
|
|
137
|
+
#if DEBUG
|
|
138
|
+
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
|
|
139
|
+
#else
|
|
140
|
+
- return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
|
|
141
|
+
+ return [CodePush bundleURL];
|
|
142
|
+
#endif
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
@end
|
|
262
146
|
|
|
263
|
-
|
|
147
|
+
```
|
|
264
148
|
|
|
265
|
-
```javascript
|
|
266
|
-
const codePushOptions = {
|
|
267
|
-
bundlehost: 'https://cdn.yours.com/codepush/bundle/',
|
|
268
|
-
}
|
|
269
149
|
|
|
270
|
-
|
|
271
|
-
```
|
|
150
|
+
### Android Manual Setup
|
|
272
151
|
|
|
273
|
-
|
|
152
|
+
#### Edit `MainApplication` Code
|
|
274
153
|
|
|
275
|
-
|
|
154
|
+
**(RN 0.82+) If you have `MainApplication.kt`**
|
|
276
155
|
|
|
277
|
-
|
|
156
|
+
```diff
|
|
157
|
+
+ import com.microsoft.codepush.react.CodePush
|
|
278
158
|
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
159
|
+
class MainApplication : Application(), ReactApplication {
|
|
160
|
+
override val reactHost: ReactHost by lazy {
|
|
161
|
+
getDefaultReactHost(
|
|
162
|
+
context = applicationContext,
|
|
163
|
+
packageList =
|
|
164
|
+
PackageList(this).packages.apply {
|
|
165
|
+
// Packages that cannot be autolinked yet can be added manually here, for example:
|
|
166
|
+
// add(MyReactNativePackage())
|
|
167
|
+
},
|
|
168
|
+
+ jsBundleFilePath = CodePush.getJSBundleFile(),
|
|
169
|
+
)
|
|
170
|
+
}
|
|
171
|
+
// ...
|
|
292
172
|
}
|
|
293
|
-
|
|
294
|
-
export default codePush(codePushOptions)(MyApp)
|
|
295
173
|
```
|
|
296
174
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
---
|
|
175
|
+
**(RN 0.73+) If you have `MainApplication.kt`**
|
|
300
176
|
|
|
301
|
-
|
|
177
|
+
```diff
|
|
178
|
+
+ import com.microsoft.codepush.react.CodePush
|
|
302
179
|
|
|
303
|
-
|
|
180
|
+
class MainApplication : Application(), ReactApplication {
|
|
181
|
+
override val reactNativeHost: ReactNativeHost =
|
|
182
|
+
object : DefaultReactNativeHost(this) {
|
|
304
183
|
|
|
305
|
-
|
|
184
|
+
// ...
|
|
306
185
|
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
<!-- React Native Catalog -->
|
|
314
|
-
|
|
315
|
-
- [How does it work?](#how-does-it-work)
|
|
316
|
-
- [Supported React Native Platforms](#supported-react-native-platforms)
|
|
317
|
-
- [Supported Components](#supported-components)
|
|
318
|
-
- [Getting Started](#getting-started)
|
|
319
|
-
- [iOS Setup](docs/setup-ios.md)
|
|
320
|
-
- [Android Setup](docs/setup-android.md)
|
|
321
|
-
- [Plugin Usage](#plugin-usage)
|
|
322
|
-
- [Store Guideline Compliance](#store-guideline-compliance)
|
|
323
|
-
- [Releasing Updates](#releasing-updates)
|
|
324
|
-
- [Multi-Deployment Testing](#multi-deployment-testing)
|
|
325
|
-
- [Android](docs/multi-deployment-testing-android.md)
|
|
326
|
-
- [iOS](docs/multi-deployment-testing-ios.md)
|
|
327
|
-
- [Dynamic Deployment Assignment](#dynamic-deployment-assignment)
|
|
328
|
-
- [API Reference](#api-reference)
|
|
329
|
-
- [JavaScript API](docs/api-js.md)
|
|
330
|
-
- [Objective-C API Reference (iOS)](docs/api-ios.md)
|
|
331
|
-
- [Java API Reference (Android)](docs/api-android.md)
|
|
332
|
-
- [Debugging / Troubleshooting](#debugging--troubleshooting)
|
|
333
|
-
- [Example Apps / Starters](#example-apps--starters)
|
|
334
|
-
- [Continuous Integration / Delivery](#continuous-integration--delivery)
|
|
335
|
-
- [TypeScript Consumption](#typescript-consumption)
|
|
336
|
-
|
|
337
|
-
<!-- React Native Catalog -->
|
|
338
|
-
|
|
339
|
-
## How does it work?
|
|
340
|
-
|
|
341
|
-
A React Native app is composed of JavaScript files and any accompanying [images](https://reactnative.dev/docs/image), which are bundled together by the [metro bundler](https://github.com/facebook/metro) and distributed as part of a platform-specific binary (i.e. an `.ipa` or `.apk` file). Once the app is released, updating either the JavaScript code (e.g. making bug fixes, adding new features) or image assets, requires you to recompile and redistribute the entire binary, which of course, includes any review time associated with the store(s) you are publishing to.
|
|
342
|
-
|
|
343
|
-
The CodePush plugin helps get product improvements in front of your end users instantly, by keeping your JavaScript and images synchronized with updates you release to the CodePush server. This way, your app gets the benefits of an offline mobile experience, as well as the "web-like" agility of side-loading updates as soon as they are available. It's a win-win!
|
|
344
|
-
|
|
345
|
-
In order to ensure that your end users always have a functioning version of your app, the CodePush plugin maintains a copy of the previous update, so that in the event that you accidentally push an update which includes a crash, it can automatically roll back. This way, you can rest assured that your newfound release agility won't result in users becoming blocked before you have a chance to [roll back](https://docs.microsoft.com/en-us/appcenter/distribution/codepush/cli#rolling-back-updates) on the server. It's a win-win-win!
|
|
346
|
-
|
|
347
|
-
_Note: Any product changes which touch native code (e.g. modifying your `AppDelegate.m`/`MainActivity.java` file, adding a new plugin) cannot be distributed via CodePush, and therefore, must be updated via the appropriate store(s)._
|
|
348
|
-
|
|
349
|
-
## Supported React Native platforms
|
|
350
|
-
|
|
351
|
-
- iOS (7+)
|
|
352
|
-
- Android (4.1+) on TLS 1.2 compatible devices
|
|
353
|
-
|
|
354
|
-
We try our best to maintain backwards compatibility of our plugin with previous versions of React Native, but due to the nature of the platform, and the existence of breaking changes between releases, it is possible that you need to use a specific version of the CodePush plugin in order to support the exact version of React Native you are using. The following table outlines which CodePush plugin versions officially support the respective React Native versions:
|
|
355
|
-
|
|
356
|
-
| React Native version(s) | Supporting CodePush version(s) |
|
|
357
|
-
| ----------------------- | ------------------------------------------------------ |
|
|
358
|
-
| <0.14 | **Unsupported** |
|
|
359
|
-
| v0.14 | v1.3 _(introduced Android support)_ |
|
|
360
|
-
| v0.15-v0.18 | v1.4-v1.6 _(introduced iOS asset support)_ |
|
|
361
|
-
| v0.19-v0.28 | v1.7-v1.17 _(introduced Android asset support)_ |
|
|
362
|
-
| v0.29-v0.30 | v1.13-v1.17 _(RN refactored native hosting code)_ |
|
|
363
|
-
| v0.31-v0.33 | v1.14.6-v1.17 _(RN refactored native hosting code)_ |
|
|
364
|
-
| v0.34-v0.35 | v1.15-v1.17 _(RN refactored native hosting code)_ |
|
|
365
|
-
| v0.36-v0.39 | v1.16-v1.17 _(RN refactored resume handler)_ |
|
|
366
|
-
| v0.40-v0.42 | v1.17 _(RN refactored iOS header files)_ |
|
|
367
|
-
| v0.43-v0.44 | v2.0+ _(RN refactored uimanager dependencies)_ |
|
|
368
|
-
| v0.45 | v3.0+ _(RN refactored instance manager code)_ |
|
|
369
|
-
| v0.46 | v4.0+ _(RN refactored js bundle loader code)_ |
|
|
370
|
-
| v0.46-v0.53 | v5.1+ _(RN removed unused registration of JS modules)_ |
|
|
371
|
-
| v0.54-v0.55 | v5.3+ _(Android Gradle Plugin 3.x integration)_ |
|
|
372
|
-
| v0.56-v0.58 | v5.4+ _(RN upgraded versions for Android tools)_ |
|
|
373
|
-
| v0.59 | v5.6+ _(RN refactored js bundle loader code)_ |
|
|
374
|
-
| v0.60-v0.61 | v6.0+ _(RN migrated to Autolinking)_ |
|
|
375
|
-
| v0.62-v0.64 | v6.2+ _(RN removed LiveReload)_ |
|
|
376
|
-
| v0.65-v0.70 | v7.0+ _(RN updated iPhone-target-version)_ |
|
|
377
|
-
| v0.71 | v8.0+ _(RN moved to react-native-gradle-plugin)_ |
|
|
186
|
+
+ override fun getJSBundleFile(): String = CodePush.getJSBundleFile()
|
|
187
|
+
}
|
|
188
|
+
// ...
|
|
189
|
+
}
|
|
190
|
+
```
|
|
378
191
|
|
|
379
|
-
_NOTE: `react-native-code-push` versions lower than **[v5.7.0](https://github.com/microsoft/react-native-code-push/releases/tag/v5.7.0)** will stop working in the near future. You can find more information in our [documentation](https://github.com/microsoft/code-push/blob/master/migration-notice.md)._
|
|
380
192
|
|
|
381
|
-
|
|
193
|
+
**Or if you have `MainApplication.java`**
|
|
382
194
|
|
|
383
|
-
|
|
195
|
+
```diff
|
|
196
|
+
// ...
|
|
197
|
+
+ import com.microsoft.codepush.react.CodePush
|
|
384
198
|
|
|
385
|
-
|
|
199
|
+
public class MainApplication extends Application implements ReactApplication {
|
|
386
200
|
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
| `Image` | `source` |
|
|
390
|
-
| `MapView.Marker` <br />_(Requires [react-native-maps](https://github.com/lelandrichardson/react-native-maps) `>=O.3.2`)_ | `image` |
|
|
391
|
-
| `ProgressViewIOS` | `progressImage`, `trackImage` |
|
|
392
|
-
| `TabBarIOS.Item` | `icon`, `selectedIcon` |
|
|
393
|
-
| `ToolbarAndroid` <br />_(React Native 0.21.0+)_ | `actions[].icon`, `logo`, `overflowIcon` |
|
|
394
|
-
| `Video` | `source` |
|
|
201
|
+
private final ReactNativeHost mReactNativeHost =
|
|
202
|
+
new DefaultReactNativeHost(this) {
|
|
395
203
|
|
|
396
|
-
|
|
204
|
+
// ...
|
|
205
|
+
|
|
206
|
+
+ @Override
|
|
207
|
+
+ override fun getJSBundleFile(): String {
|
|
208
|
+
+ return CodePush.getJSBundleFile()
|
|
209
|
+
+ }
|
|
210
|
+
};
|
|
211
|
+
// ...
|
|
212
|
+
}
|
|
213
|
+
```
|
|
397
214
|
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
| `SliderIOS` | `maximumTrackImage`, `minimumTrackImage`, `thumbImage`, `trackImage` |
|
|
401
|
-
| `Video` | `source` |
|
|
215
|
+
</p>
|
|
216
|
+
</details>
|
|
402
217
|
|
|
403
|
-
As new core components are released, which support referencing assets, we'll update this list to ensure users know what exactly they can expect to update using CodePush.
|
|
404
218
|
|
|
405
|
-
|
|
219
|
+
### 3. Expo Setup
|
|
220
|
+
For Expo projects, you can use the automated config plugin instead of manual setup.
|
|
406
221
|
|
|
407
|
-
|
|
408
|
-
|
|
222
|
+
**Add plugin to your Expo configuration:**
|
|
223
|
+
```js
|
|
224
|
+
// app.config.js
|
|
225
|
+
export default {
|
|
226
|
+
expo: {
|
|
227
|
+
plugins: ["@bravemobile/react-native-code-push"],
|
|
228
|
+
},
|
|
229
|
+
};
|
|
409
230
|
```
|
|
410
231
|
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
```shell
|
|
416
|
-
npm install --save react-native-code-push
|
|
232
|
+
**Run prebuild to apply changes:**
|
|
233
|
+
```bash
|
|
234
|
+
npx expo prebuild
|
|
417
235
|
```
|
|
418
236
|
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
If you want to see how other projects have integrated with CodePush, you can check out the excellent [example apps](#example-apps--starters) provided by the community. Additionally, if you'd like to quickly familiarize yourself with CodePush + React Native, you can check out the awesome getting started videos produced by [Bilal Budhani](https://www.youtube.com/watch?v=uN0FRWk-YW8&feature=youtu.be) and/or [Deepak Sisodiya ](https://www.youtube.com/watch?v=f6I9y7V-Ibk).
|
|
422
|
-
|
|
423
|
-
_NOTE: This guide assumes you have used the `react-native init` command to initialize your React Native project. As of March 2017, the command `create-react-native-app` can also be used to initialize a React Native project. If using this command, please run `npm run eject` in your project's home directory to get a project very similar to what `react-native init` would have created._
|
|
424
|
-
|
|
425
|
-
Then continue with installing the native module
|
|
426
|
-
|
|
427
|
-
- [iOS Setup](docs/setup-ios.md)
|
|
428
|
-
- [Android Setup](docs/setup-android.md)
|
|
429
|
-
|
|
430
|
-
## Plugin Usage
|
|
431
|
-
|
|
432
|
-
With the CodePush plugin downloaded and linked, and your app asking CodePush where to get the right JS bundle from, the only thing left is to add the necessary code to your app to control the following policies:
|
|
237
|
+
> [!NOTE]
|
|
238
|
+
> The plugin automatically handles all native iOS and Android code modifications. No manual editing of AppDelegate, MainApplication, or gradle files is required.
|
|
433
239
|
|
|
434
|
-
|
|
240
|
+
**Requirements**
|
|
241
|
+
Expo SDK: 50.0.0 or higher
|
|
435
242
|
|
|
436
|
-
2. When an update is available, how to present it to the end user?
|
|
437
243
|
|
|
438
|
-
|
|
244
|
+
### 4. "CodePush-ify" Your App
|
|
439
245
|
|
|
440
|
-
|
|
246
|
+
The root component of your app should be wrapped with a higher-order component.
|
|
441
247
|
|
|
442
|
-
|
|
248
|
+
You should also pass configuration options, including the implementation of the `releaseHistoryFetcher` function.
|
|
249
|
+
This function is used to find the latest CodePush update within the `ReleaseHistoryInterface` data.
|
|
443
250
|
|
|
444
|
-
|
|
445
|
-
|
|
251
|
+
To enable this, you need to create a release history using the CLI tool and upload it to the remote.
|
|
252
|
+
(The following steps explain more about the CLI.)
|
|
446
253
|
|
|
447
|
-
|
|
254
|
+
At runtime, the library fetches this information to keep the app up to date.
|
|
448
255
|
|
|
449
|
-
|
|
450
|
-
|
|
256
|
+
```typescript
|
|
257
|
+
import CodePush, {
|
|
258
|
+
ReleaseHistoryInterface,
|
|
259
|
+
UpdateCheckRequest,
|
|
260
|
+
} from "@bravemobile/react-native-code-push";
|
|
451
261
|
|
|
452
|
-
|
|
262
|
+
// ... MyApp Component
|
|
453
263
|
|
|
454
|
-
|
|
455
|
-
|
|
264
|
+
async function releaseHistoryFetcher(
|
|
265
|
+
updateRequest: UpdateCheckRequest,
|
|
266
|
+
): Promise<ReleaseHistoryInterface> {
|
|
456
267
|
|
|
457
|
-
|
|
268
|
+
// Fetch release history for current binary app version.
|
|
269
|
+
// You can implement how to fetch the release history freely. (Refer to the example app if you need a guide)
|
|
458
270
|
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
_NOTE: Decorators are not yet supported in Babel 6.x pending proposal update._ You may need to enable it by installing and using [babel-preset-react-native-stage-0](https://github.com/skevy/babel-preset-react-native-stage-0#babel-preset-react-native-stage-0).
|
|
465
|
-
|
|
466
|
-
- For class component
|
|
467
|
-
|
|
468
|
-
```javascript
|
|
469
|
-
import codePush from 'react-native-code-push'
|
|
271
|
+
const {data: releaseHistory} = await axios.get<ReleaseHistoryInterface>(
|
|
272
|
+
`https://your.cdn.com/histories/${platform}/${identifier}/${updateRequest.app_version}.json`,
|
|
273
|
+
);
|
|
274
|
+
return releaseHistory;
|
|
275
|
+
}
|
|
470
276
|
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
277
|
+
export default CodePush({
|
|
278
|
+
checkFrequency: CodePush.CheckFrequency.MANUAL, // or something else
|
|
279
|
+
releaseHistoryFetcher: releaseHistoryFetcher,
|
|
280
|
+
})(MyApp);
|
|
474
281
|
|
|
475
|
-
|
|
282
|
+
```
|
|
476
283
|
|
|
477
|
-
|
|
478
|
-
|
|
284
|
+
> [!NOTE]
|
|
285
|
+
> The URL for fetching the release history should point to the resource location generated by the CLI tool.
|
|
479
286
|
|
|
480
|
-
const MyApp: () => React$Node = () => {}
|
|
481
287
|
|
|
482
|
-
|
|
483
|
-
```
|
|
288
|
+
#### 4-1. Telemetry Callbacks
|
|
484
289
|
|
|
485
|
-
|
|
290
|
+
Please refer to the [CodePushOptions](https://github.com/Soomgo-Mobile/react-native-code-push/blob/f0d26f7614af41c6dd4daecd9f7146e2383b2b0d/typings/react-native-code-push.d.ts#L76-L95) type for more details.
|
|
291
|
+
- **onUpdateSuccess:** Triggered when the update bundle is executed successfully.
|
|
292
|
+
- **onUpdateRollback:** Triggered when there is an issue executing the update bundle, leading to a rollback.
|
|
293
|
+
- **onDownloadStart:** Triggered when the bundle download begins.
|
|
294
|
+
- **onDownloadSuccess:** Triggered when the bundle download completes successfully.
|
|
295
|
+
- **onSyncError:** Triggered when an unknown error occurs during the update process. (`CodePush.SyncStatus.UNKNOWN_ERROR` status)
|
|
486
296
|
|
|
487
|
-
If you would like your app to discover updates more quickly, you can also choose to sync up with the CodePush server every time the app resumes from the background.
|
|
488
297
|
|
|
489
|
-
|
|
298
|
+
### 5. Configure the CLI Tool
|
|
490
299
|
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
checkFrequency: codePush.CheckFrequency.ON_APP_RESUME,
|
|
494
|
-
}
|
|
300
|
+
> [!TIP]
|
|
301
|
+
> For a more detailed and practical example, refer to the `CodePushDemoApp` in `example` directory. ([link](https://github.com/Soomgo-Mobile/react-native-code-push/tree/master/Examples/CodePushDemoApp))
|
|
495
302
|
|
|
496
|
-
|
|
303
|
+
**(1) Create a `code-push.config.ts` file in the root directory of your project.**
|
|
497
304
|
|
|
498
|
-
|
|
499
|
-
|
|
305
|
+
Then, implement three functions to upload the bundle file and create/update the release history.
|
|
306
|
+
The CLI tool uses these functions to release CodePush updates and manage releases.
|
|
307
|
+
(These functions are not used at runtime by the library.)
|
|
500
308
|
|
|
501
|
-
|
|
309
|
+
You can copy and paste the following code and modify it as needed.
|
|
502
310
|
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
311
|
+
```typescript
|
|
312
|
+
import {
|
|
313
|
+
CliConfigInterface,
|
|
314
|
+
ReleaseHistoryInterface,
|
|
315
|
+
} from "@bravemobile/react-native-code-push";
|
|
507
316
|
|
|
508
|
-
|
|
317
|
+
const Config: CliConfigInterface = {
|
|
318
|
+
bundleUploader: async (
|
|
319
|
+
source: string,
|
|
320
|
+
platform: "ios" | "android",
|
|
321
|
+
identifier,
|
|
322
|
+
): Promise<{downloadUrl: string}> => {
|
|
323
|
+
// ...
|
|
324
|
+
},
|
|
509
325
|
|
|
510
|
-
|
|
511
|
-
|
|
326
|
+
getReleaseHistory: async (
|
|
327
|
+
targetBinaryVersion: string,
|
|
328
|
+
platform: "ios" | "android",
|
|
329
|
+
identifier,
|
|
330
|
+
): Promise<ReleaseHistoryInterface> => {
|
|
331
|
+
// ...
|
|
332
|
+
},
|
|
512
333
|
|
|
513
|
-
|
|
334
|
+
setReleaseHistory: async (
|
|
335
|
+
targetBinaryVersion: string,
|
|
336
|
+
jsonFilePath: string,
|
|
337
|
+
releaseInfo: ReleaseHistoryInterface,
|
|
338
|
+
platform: "ios" | "android",
|
|
339
|
+
identifier,
|
|
340
|
+
): Promise<void> => {
|
|
341
|
+
// ...
|
|
342
|
+
},
|
|
343
|
+
};
|
|
514
344
|
|
|
515
|
-
|
|
516
|
-
let codePushOptions = { checkFrequency: codePush.CheckFrequency.MANUAL }
|
|
345
|
+
module.exports = Config;
|
|
517
346
|
|
|
518
|
-
|
|
519
|
-
onButtonPress() {
|
|
520
|
-
codePush.sync({
|
|
521
|
-
updateDialog: true,
|
|
522
|
-
installMode: codePush.InstallMode.IMMEDIATE,
|
|
523
|
-
})
|
|
524
|
-
}
|
|
347
|
+
```
|
|
525
348
|
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
349
|
+
**`bundleUploader`**
|
|
350
|
+
- Implements a function to upload the bundle file.
|
|
351
|
+
- The `downloadUrl` returned by this function is recorded in `ReleaseHistoryInterface` data
|
|
352
|
+
and is used by the library runtime to download the bundle file from this URL.
|
|
353
|
+
- Used in the following cases:
|
|
354
|
+
- Creating a new CodePush update with the `release` command.
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
**`getReleaseHistory`**
|
|
358
|
+
- Retrieves the release history of a specific binary app by fetching a JSON file or calling an API.
|
|
359
|
+
- Used in the following cases:
|
|
360
|
+
- Printing the release history with the `show-history` command.
|
|
361
|
+
- Loading existing release history during the `release` command.
|
|
362
|
+
- Fetching release history to modify information in the `update-history` command.
|
|
363
|
+
|
|
364
|
+
(Similar to the `releaseHistoryFetcher` function in the library runtime options.)
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
**`setReleaseHistory`**
|
|
368
|
+
- Uploads a JSON file located at `jsonFilePath` or calls an API using `releaseInfo` metadata.
|
|
369
|
+
- If using a JSON file, **modifying the existing file should be allowed.**
|
|
370
|
+
(Overwriting the file is recommended.)
|
|
371
|
+
- Used in the following cases:
|
|
372
|
+
- Creating a new release record for a new binary build with the `create-history` command.
|
|
373
|
+
- Appending a new record to an existing release history with the `release` command.
|
|
374
|
+
- Modifying an existing release history with the `update-history` command.
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
**(2) For `code-push.config.ts` (TypeScript) to work properly, you may need to update your `tsconfig.json`.**
|
|
378
|
+
|
|
379
|
+
```diff
|
|
380
|
+
{
|
|
381
|
+
"extends": "@react-native/typescript-config/tsconfig.json",
|
|
382
|
+
// ...
|
|
383
|
+
"include": [
|
|
384
|
+
// ...
|
|
385
|
+
+ "code-push.config.ts"
|
|
386
|
+
],
|
|
387
|
+
+ "ts-node": {
|
|
388
|
+
+ "compilerOptions": {
|
|
389
|
+
+ "module": "CommonJS",
|
|
390
|
+
+ "types": ["node"]
|
|
391
|
+
+ }
|
|
392
|
+
+ }
|
|
534
393
|
}
|
|
535
|
-
}
|
|
536
394
|
|
|
537
|
-
MyApp = codePush(codePushOptions)(MyApp)
|
|
538
395
|
```
|
|
539
396
|
|
|
540
|
-
If you would like to display an update confirmation dialog (an "active install"), configure when an available update is installed (like force an immediate restart) or customize the update experience in any other way, refer to the [`codePush()`](docs/api-js.md#codepush) API reference for information on how to tweak this default behavior.
|
|
541
|
-
|
|
542
|
-
_NOTE: If you are using [Redux](http://redux.js.org) and [Redux Saga](https://redux-saga.js.org/), you can alternatively use the [react-native-code-push-saga](http://github.com/lostintangent/react-native-code-push-saga) module, which allows you to customize when `sync` is called in a perhaps simpler/more idiomatic way._
|
|
543
|
-
|
|
544
|
-
### Store Guideline Compliance
|
|
545
|
-
|
|
546
|
-
Android Google Play and iOS App Store have corresponding guidelines that have rules you should be aware of before integrating the CodePush solution within your application.
|
|
547
|
-
|
|
548
|
-
#### Google play
|
|
549
|
-
|
|
550
|
-
Third paragraph of [Device and Network Abuse](https://support.google.com/googleplay/android-developer/answer/9888379?hl=en) topic describe that updating source code by any method other than Google Play's update mechanism is restricted. But this restriction does not apply to updating javascript bundles.
|
|
551
|
-
|
|
552
|
-
> This restriction does not apply to code that runs in a virtual machine and has limited access to Android APIs (such as JavaScript in a webview or browser).
|
|
553
397
|
|
|
554
|
-
|
|
398
|
+
## 🚀 CLI Tool Usage
|
|
555
399
|
|
|
556
|
-
|
|
400
|
+
> [!TIP]
|
|
401
|
+
> You can use `--help` command to see the available commands and options.
|
|
402
|
+
>
|
|
403
|
+
> For detailed documentation, see the [CLI README](cli/README.md) ([한국어](cli/README.ko.md)).
|
|
557
404
|
|
|
558
|
-
|
|
405
|
+
(interactive mode not supported yet)
|
|
559
406
|
|
|
560
|
-
|
|
407
|
+
### Commands
|
|
561
408
|
|
|
562
|
-
CodePush allows you to follow these rules in full compliance so long as the update you push does not significantly deviate your product from its original App Store approved intent.
|
|
563
409
|
|
|
564
|
-
|
|
410
|
+
#### `create-history`
|
|
565
411
|
|
|
566
|
-
|
|
412
|
+
Create a new release history for a specific binary app version.
|
|
413
|
+
- Use this command whenever you release a new binary app to the app store.
|
|
414
|
+
This ensures that the library runtime recognizes the binary app as the latest version and determines that no CodePush update is available for it.
|
|
567
415
|
|
|
568
|
-
|
|
416
|
+
**Example:**
|
|
417
|
+
- Create a new release history for the binary app version `1.0.0`.
|
|
569
418
|
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
Once your app is configured and distributed to your users, and you have made some JS or asset changes, it's time to release them. The recommended way to release them is using the `release-react` command in the App Center CLI, which will bundle your JavaScript files, asset files, and release the update to the CodePush server.
|
|
573
|
-
|
|
574
|
-
_NOTE: Before you can start releasing updates, please log into App Center by running the `appcenter login` command._
|
|
575
|
-
|
|
576
|
-
In its most basic form, this command only requires one parameter: your owner name + "/" + app name.
|
|
577
|
-
|
|
578
|
-
```shell
|
|
579
|
-
appcenter codepush release-react -a <ownerName>/<appName>
|
|
580
|
-
|
|
581
|
-
appcenter codepush release-react -a <ownerName>/MyApp-iOS
|
|
582
|
-
appcenter codepush release-react -a <ownerName>/MyApp-Android
|
|
419
|
+
```bash
|
|
420
|
+
npx code-push create-history --binary-version 1.0.0 --platform ios --identifier staging
|
|
583
421
|
```
|
|
584
422
|
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
```shell
|
|
588
|
-
# Release a mandatory update with a changelog
|
|
589
|
-
appcenter codepush release-react -a <ownerName>/MyApp-iOS -m --description "Modified the header color"
|
|
423
|
+
#### `show-history`
|
|
590
424
|
|
|
591
|
-
|
|
592
|
-
# the sourcemap file generated by react-native bundle
|
|
593
|
-
appcenter codepush release-react -a <ownerName>/MyApp-iOS --entry-file MyApp.js --sourcemap-output ../maps/MyApp.map
|
|
425
|
+
Display the release history for a specific binary app version.
|
|
594
426
|
|
|
595
|
-
# Release a dev Android build to just 1/4 of your end users
|
|
596
|
-
appcenter codepush release-react -a <ownerName>/MyApp-Android --rollout 25 --development true
|
|
597
427
|
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
appcenter codepush release-react -a <ownerName>/MyApp-Android --target-binary-version "~1.1.0"
|
|
428
|
+
**Example:**
|
|
429
|
+
- Show the release history for the binary app version `1.0.0`.
|
|
601
430
|
|
|
431
|
+
```bash
|
|
432
|
+
npx code-push show-history --binary-version 1.0.0 --platform ios --identifier staging
|
|
602
433
|
```
|
|
603
434
|
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
For more details about how the `release-react` command works, as well as the various parameters it exposes, refer to the [CLI docs](https://github.com/microsoft/code-push/tree/v3.0.1/cli#releasing-updates-react-native). Additionally, if you would prefer to handle running the `react-native bundle` command yourself, and therefore, want an even more flexible solution than `release-react`, refer to the [`release` command](https://github.com/microsoft/code-push/tree/v3.0.1/cli#releasing-updates-general) for more details.
|
|
607
|
-
|
|
608
|
-
If you run into any issues, or have any questions/comments/feedback, you can ping us within the [#code-push](https://discord.gg/0ZcbPKXt5bWxFdFu) channel on Reactiflux, [e-mail us](mailto:codepushfeed@microsoft.com) and/or check out the [troubleshooting](#debugging--troubleshooting) details below.
|
|
435
|
+
#### `release`
|
|
609
436
|
|
|
610
|
-
|
|
437
|
+
Release a CodePush update for a specific binary app version.
|
|
438
|
+
- This command creates a CodePush bundle file, uploads it, and updates the release history with the new release information.
|
|
611
439
|
|
|
612
|
-
|
|
440
|
+
**Example:**
|
|
441
|
+
- Release a CodePush update `1.0.1` targeting the binary app version `1.0.0`.
|
|
613
442
|
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
Taking advantage of the `Staging` and `Production` deployments allows you to achieve a workflow like the following (feel free to customize!):
|
|
619
|
-
|
|
620
|
-
1. Release a CodePush update to your `Staging` deployment using the `appcenter codepush release-react` command (or `appcenter codepush release` if you need more control)
|
|
621
|
-
|
|
622
|
-
2. Run your staging/beta build of your app, sync the update from the server, and verify it works as expected
|
|
623
|
-
|
|
624
|
-
3. Promote the tested release from `Staging` to `Production` using the `appcenter codepush promote` command
|
|
625
|
-
|
|
626
|
-
4. Run your production/release build of your app, sync the update from the server and verify it works as expected
|
|
627
|
-
|
|
628
|
-
_NOTE: If you want to take a more cautious approach, you can even choose to perform a "staged rollout" as part of #3, which allows you to mitigate additional potential risk with the update (like did your testing in #2 touch all possible devices/conditions?) by only making the production update available to a percentage of your users (for example `appcenter codepush promote -a <ownerName>/<appName> -s Staging -d Production -r 20`). Then, after waiting for a reasonable amount of time to see if any crash reports or customer feedback comes in, you can expand it to your entire audience by running `appcenter codepush patch -a <ownerName>/<appName> Production -r 100`._
|
|
629
|
-
|
|
630
|
-
You'll notice that the above steps refer to a "staging build" and "production build" of your app. If your build process already generates distinct binaries per "environment", then you don't need to read any further, since swapping out CodePush deployment keys is just like handling environment-specific config for any other service your app uses (like Facebook). However, if you're looking for examples (**including demo projects**) on how to setup your build process to accommodate this, then refer to the following sections, depending on the platform(s) your app is targeting:
|
|
631
|
-
|
|
632
|
-
- [Android](docs/multi-deployment-testing-android.md)
|
|
633
|
-
- [iOS](docs/multi-deployment-testing-ios.md)
|
|
634
|
-
|
|
635
|
-
### Dynamic Deployment Assignment
|
|
636
|
-
|
|
637
|
-
The above section illustrated how you can leverage multiple CodePush deployments in order to effectively test your updates before broadly releasing them to your end users. However, since that workflow statically embeds the deployment assignment into the actual binary, a staging or production build will only ever sync updates from that deployment. In many cases, this is sufficient, since you only want your team, customers, stakeholders, etc. to sync with your pre-production releases, and therefore, only they need a build that knows how to sync with staging. However, if you want to be able to perform A/B tests, or provide early access of your app to certain users, it can prove very useful to be able to dynamically place specific users (or audiences) into specific deployments at runtime.
|
|
638
|
-
|
|
639
|
-
In order to achieve this kind of workflow, all you need to do is specify the deployment key you want the current user to syncronize with when calling the `codePush` method. When specified, this key will override the "default" one that was provided in your app's `Info.plist` (iOS) or `MainActivity.java` (Android) files. This allows you to produce a build for staging or production, that is also capable of being dynamically "redirected" as needed.
|
|
443
|
+
```bash
|
|
444
|
+
npx code-push release --binary-version 1.0.0 --app-version 1.0.1 \
|
|
445
|
+
--platform ios --identifier staging --entry-file index.js \
|
|
446
|
+
--mandatory true
|
|
640
447
|
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
// which includes the deployment key that the current user should use.
|
|
644
|
-
codePush.sync({ deploymentKey: userProfile.CODEPUSH_KEY })
|
|
448
|
+
# Expo project
|
|
449
|
+
npx code-push release --framework expo --binary-version 1.0.0 --app-version 1.0.1 --platform ios
|
|
645
450
|
```
|
|
451
|
+
- `--framework`(`-f`) : Framework type (expo)
|
|
452
|
+
- `--binary-version`: The version of the binary app that the CodePush update is targeting.
|
|
453
|
+
- `--app-version`: The version of the CodePush update itself.
|
|
646
454
|
|
|
647
|
-
|
|
455
|
+
> [!IMPORTANT]
|
|
456
|
+
> `--app-version` should be greater than `--binary-version` (SemVer comparison).
|
|
648
457
|
|
|
649
|
-
|
|
458
|
+
- `--rollout`: The rollout percentage for the update. (0~100, inclusive)
|
|
650
459
|
|
|
651
|
-
|
|
460
|
+
#### `update-history`
|
|
652
461
|
|
|
653
|
-
|
|
462
|
+
Update the release history for a specific CodePush update.
|
|
463
|
+
- Use the `--enable` option to disable a specific release for rollback. (or enable it)
|
|
464
|
+
- Use the `--mandatory` option to make the update as mandatory or optional.
|
|
465
|
+
- Use the `--rollout` option to change the rollout percentage of the update. (0~100, inclusive)
|
|
466
|
+
- If the rollout percentage is reduced, users who fall outside the new target will have their rollout canceled and rollback to the previous latest version.
|
|
654
467
|
|
|
655
|
-
|
|
468
|
+
**Example:**
|
|
469
|
+
- Rollback the CodePush update `1.0.1` (targeting the binary app version `1.0.0`).
|
|
656
470
|
|
|
657
|
-
```
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
// #2) Target any new releases at that custom deployment
|
|
662
|
-
appcenter codepush release-react -a <ownerName>/<appName> -d test-variant-one
|
|
471
|
+
```bash
|
|
472
|
+
npx code-push update-history --binary-version 1.0.0 --app-version 1.0.1 \
|
|
473
|
+
--platform ios --identifier staging \
|
|
474
|
+
--enable false
|
|
663
475
|
```
|
|
664
476
|
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
---
|
|
668
|
-
|
|
669
|
-
## API Reference
|
|
670
|
-
|
|
671
|
-
- [JavaScript API](docs/api-js.md)
|
|
672
|
-
- [Objective-C API Reference (iOS)](docs/api-ios.md)
|
|
673
|
-
- [Java API Reference (Android)](docs/api-android.md)
|
|
674
|
-
|
|
675
|
-
### Example Apps / Starters
|
|
676
|
-
|
|
677
|
-
The React Native community has graciously created some awesome open source apps that can serve as examples for developers that are getting started. The following is a list of OSS React Native apps that are also using CodePush, and can therefore be used to see how others are using the service:
|
|
477
|
+
#### `bundle`
|
|
678
478
|
|
|
679
|
-
|
|
680
|
-
- [Feline for Product Hunt](https://github.com/arjunkomath/Feline-for-Product-Hunt) - An Android client for Product Hunt.
|
|
681
|
-
- [GeoEncoding](https://github.com/LynxITDigital/GeoEncoding) - An app by [Lynx IT Digital](https://digital.lynxit.com.au) which demonstrates how to use numerous React Native components and modules.
|
|
682
|
-
- [Math Facts](https://github.com/Khan/math-facts) - An app by Khan Academy to help memorize math facts more easily.
|
|
479
|
+
Create a CodePush bundle file.
|
|
683
480
|
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
-
|
|
687
|
-
|
|
688
|
-
_Note: If you've developed a React Native app using CodePush, that is also open-source, please let us know. We would love to add it to this list!_
|
|
689
|
-
|
|
690
|
-
### Debugging / Troubleshooting
|
|
691
|
-
|
|
692
|
-
The `sync` method includes a lot of diagnostic logging out-of-the-box, so if you're encountering an issue when using it, the best thing to try first is examining the output logs of your app. This will tell you whether the app is configured correctly (like can the plugin find your deployment key?), if the app is able to reach the server, if an available update is being discovered, if the update is being successfully downloaded/installed, etc. We want to continue improving the logging to be as intuitive/comprehensive as possible, so please [let us know](mailto:codepushfeed@microsoft.com) if you find it to be confusing or missing anything.
|
|
693
|
-
|
|
694
|
-
The simplest way to view these logs is to add the flag `--debug` for each command. This will output a log stream that is filtered to just CodePush messages. This makes it easy to identify issues, without needing to use a platform-specific tool, or wade through a potentially high volume of logs.
|
|
695
|
-
|
|
696
|
-
<img width="540" alt="screen shot 2016-06-21 at 10 15 42 am" src="https://cloud.githubusercontent.com/assets/116461/16246973/838e2e98-37bc-11e6-9649-685f39e325a0.png">
|
|
697
|
-
|
|
698
|
-
Additionally, you can also use any of the platform-specific tools to view the CodePush logs, if you are more comfortable with them. Simple start up the Chrome DevTools Console, the Xcode Console (iOS), the [OS X Console](https://en.wikipedia.org/wiki/Console_%28OS_X%29#.7E.2FLibrary.2FLogs) (iOS) and/or ADB logcat (Android), and look for messages which are prefixed with `[CodePush]`.
|
|
699
|
-
|
|
700
|
-
Note that by default, React Native logs are disabled on iOS in release builds, so if you want to view them in a release build, you need to make the following changes to your `AppDelegate.m` file:
|
|
701
|
-
|
|
702
|
-
1. Add an `#import <React/RCTLog.h>` statement. For RN < v0.40 use: `#import "RCTLog.h"`
|
|
703
|
-
|
|
704
|
-
2. Add the following statement to the top of your `application:didFinishLaunchingWithOptions` method:
|
|
705
|
-
|
|
706
|
-
```objective-c
|
|
707
|
-
RCTSetLogThreshold(RCTLogLevelInfo);
|
|
708
|
-
```
|
|
709
|
-
|
|
710
|
-
Now you'll be able to see CodePush logs in either debug or release mode, on both iOS or Android. If examining the logs don't provide an indication of the issue, please refer to the following common issues for additional resolution ideas:
|
|
711
|
-
|
|
712
|
-
| Issue / Symptom | Possible Solution |
|
|
713
|
-
| ---------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
714
|
-
| Compilation Error | Double-check that your version of React Native is [compatible](#supported-react-native-platforms) with the CodePush version you are using. |
|
|
715
|
-
| Network timeout / hang when calling `sync` or `checkForUpdate` in the iOS Simulator | Try resetting the simulator by selecting the `Simulator -> Reset Content and Settings..` menu item, and then re-running your app. |
|
|
716
|
-
| Server responds with a `404` when calling `sync` or `checkForUpdate` | Double-check that the deployment key you added to your `Info.plist` (iOS), `build.gradle` (Android) or that you're passing to `sync`/`checkForUpdate`, is in fact correct. You can run `appcenter codepush deployment list <ownerName>/<appName> --displayKeys` to view the correct keys for your app deployments. |
|
|
717
|
-
| Update not being discovered | Double-check that the version of your running app (like `1.0.0`) matches the version you specified when releasing the update to CodePush. Additionally, make sure that you are releasing to the same deployment that your app is configured to sync with. |
|
|
718
|
-
| Update not being displayed after restart | If you're not calling `sync` on app start (like within `componentDidMount` of your root component), then you need to explicitly call `notifyApplicationReady` on app start, otherwise, the plugin will think your update failed and roll it back. |
|
|
719
|
-
| I've released an update for iOS but my Android app also shows an update and it breaks it | Be sure you have different deployment keys for each platform in order to receive updates correctly |
|
|
720
|
-
| I've released new update but changes are not reflected | Be sure that you are running app in modes other than Debug. In Debug mode, React Native app always downloads JS bundle generated by packager, so JS bundle downloaded by CodePush does not apply. |
|
|
721
|
-
| No JS bundle is being found when running your app against the iOS simulator | By default, React Native doesn't generate your JS bundle when running against the simulator. Therefore, if you're using `[CodePush bundleURL]`, and targetting the iOS simulator, you may be getting a `nil` result. This issue will be fixed in RN 0.22.0, but only for release builds. You can unblock this scenario right now by making [this change](https://github.com/facebook/react-native/commit/9ae3714f4bebdd2bcab4d7fdbf23acebdc5ed2ba) locally. |
|
|
722
|
-
|
|
723
|
-
### Continuous Integration / Delivery
|
|
724
|
-
|
|
725
|
-
In addition to being able to use the CodePush CLI to "manually" release updates, we believe that it's important to create a repeatable and sustainable solution for contiously delivering updates to your app. That way, it's simple enough for you and/or your team to create and maintain the rhythm of performing agile deployments. In order to assist with setting up a CodePush-based CD pipeline, refer to the following integrations with various CI servers:
|
|
726
|
-
|
|
727
|
-
- [Visual Studio Team Services](https://marketplace.visualstudio.com/items?itemName=ms-vsclient.code-push) - _NOTE: VSTS also has extensions for publishing to [HockeyApp](https://marketplace.visualstudio.com/items?itemName=ms.hockeyapp) and the [Google Play](https://github.com/microsoft/google-play-vsts-extension) store, so it provides a pretty great mobile CD solution in general._
|
|
728
|
-
- [Travis CI](https://github.com/mondora/code-push-travis-cli)
|
|
729
|
-
|
|
730
|
-
Additionally, if you'd like more details of what a complete mobile CI/CD workflow can look like, which includes CodePush, check out this [excellent article](https://medium.com/zeemee-engineering/zeemee-engineering-and-the-quest-for-the-holy-mobile-dev-grail-1310be4953d1) by the [ZeeMee engineering team](https://www.zeemee.com/).
|
|
481
|
+
**Example:**
|
|
482
|
+
```bash
|
|
483
|
+
npx code-push bundle --platform android --entry-file index.js
|
|
731
484
|
|
|
732
|
-
|
|
485
|
+
# Expo project
|
|
486
|
+
npx code-push bundle --framework expo --platform android --entry-file index.js
|
|
487
|
+
```
|
|
488
|
+
- `--framework`(`-f`): Framework type (expo)
|
|
733
489
|
|
|
734
|
-
|
|
490
|
+
By default, the bundle file is created in the `/build/bundleOutput` directory.
|
|
735
491
|
|
|
736
|
-
|
|
492
|
+
> [!NOTE]
|
|
493
|
+
> For Expo projects, the CLI uses `expo export:embed` command for bundling instead of React Native's bundle command.
|
|
737
494
|
|
|
738
|
-
|
|
495
|
+
(The file name represents a hash value of the bundle content.)
|