@appzung/react-native-code-push 9.0.2 → 10.0.0-rc1
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.js +22 -19
- package/LICENSE.md +1 -1
- package/README.md +159 -298
- package/android/app/.gradle/config.properties +2 -0
- package/android/app/build.gradle +1 -1
- package/android/app/local.properties +8 -0
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePush.java +27 -21
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushBuilder.java +5 -5
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushConstants.java +1 -1
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushDialog.java +1 -1
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushInstallMode.java +2 -2
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushInvalidPublicKeyException.java +2 -2
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushInvalidUpdateException.java +1 -1
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushMalformedDataException.java +2 -2
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushNativeModule.java +5 -5
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushNotInitializedException.java +2 -2
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushTelemetryManager.java +14 -14
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushUnknownException.java +2 -2
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushUpdateManager.java +1 -1
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushUpdateState.java +2 -2
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushUpdateUtils.java +1 -1
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushUtils.java +1 -1
- package/android/app/src/main/java/com/microsoft/codepush/react/DownloadProgress.java +1 -1
- package/android/app/src/main/java/com/microsoft/codepush/react/DownloadProgressCallback.java +1 -1
- package/android/app/src/main/java/com/microsoft/codepush/react/FileUtils.java +1 -1
- package/android/app/src/main/java/com/microsoft/codepush/react/ReactInstanceHolder.java +1 -1
- package/android/app/src/main/java/com/microsoft/codepush/react/SettingsManager.java +1 -1
- package/android/app/src/main/java/com/microsoft/codepush/react/TLSSocketFactory.java +1 -1
- package/android/build.gradle +1 -1
- package/android/codepush.gradle +3 -3
- package/docs/advanced-usage.md +56 -0
- package/docs/api-android.md +12 -75
- package/docs/api-ios.md +5 -17
- package/docs/api-js.md +18 -55
- package/docs/setup-android.md +15 -397
- package/docs/setup-ios.md +24 -198
- package/docs/setup-windows.md +7 -74
- package/ios/CodePush/CodePush.h +4 -4
- package/ios/CodePush/CodePush.m +8 -8
- package/ios/CodePush/CodePushConfig.m +14 -11
- package/ios/CodePush/CodePushPackage.m +60 -60
- package/ios/CodePush/CodePushTelemetryManager.m +13 -13
- package/ios/CodePush.xcodeproj/project.pbxproj +1 -562
- package/package.json +27 -24
- package/react-native.config.js +1 -1
- package/scripts/generateBundledResourcesHash.js +1 -1
- package/scripts/getFilesInFolder.js +1 -1
- package/scripts/recordFilesBeforeBundleCommand.js +1 -1
- package/typings/react-native-code-push.d.ts +22 -22
- package/windows/CodePush/CodePushConfig.cpp +3 -3
- package/windows/CodePush/CodePushConfig.h +3 -3
- package/windows/CodePush/CodePushNativeModule.cpp +27 -27
- package/windows/CodePush/CodePushNativeModule.h +4 -4
- package/windows/CodePush/CodePushTelemetryManager.cpp +12 -12
- package/windows/CodePush/CodePushTelemetryManager.h +1 -1
- package/.azurepipelines/build-rn-code-push-1es.yml +0 -104
- package/.azurepipelines/test-rn-code-push.yml +0 -94
- package/.config/CredScanSuppressions.json +0 -14
- package/SECURITY.md +0 -41
- package/docs/multi-deployment-testing-android.md +0 -148
- package/docs/multi-deployment-testing-ios.md +0 -59
- 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/Info.plist +0 -26
- package/ios/CodePush/SSZipArchive/README.md +0 -1
- package/ios/CodePush/SSZipArchive/SSZipArchive.h +0 -178
- package/ios/CodePush/SSZipArchive/SSZipArchive.m +0 -1496
- package/ios/CodePush/SSZipArchive/SSZipCommon.h +0 -71
- package/ios/CodePush/SSZipArchive/Supporting Files/PrivacyInfo.xcprivacy +0 -23
- package/ios/CodePush/SSZipArchive/include/ZipArchive.h +0 -25
- package/ios/CodePush/SSZipArchive/minizip/LICENSE +0 -17
- package/ios/CodePush/SSZipArchive/minizip/mz.h +0 -273
- package/ios/CodePush/SSZipArchive/minizip/mz_compat.c +0 -1306
- package/ios/CodePush/SSZipArchive/minizip/mz_compat.h +0 -346
- package/ios/CodePush/SSZipArchive/minizip/mz_crypt.c +0 -187
- package/ios/CodePush/SSZipArchive/minizip/mz_crypt.h +0 -65
- package/ios/CodePush/SSZipArchive/minizip/mz_crypt_apple.c +0 -526
- package/ios/CodePush/SSZipArchive/minizip/mz_os.c +0 -348
- package/ios/CodePush/SSZipArchive/minizip/mz_os.h +0 -176
- package/ios/CodePush/SSZipArchive/minizip/mz_os_posix.c +0 -350
- package/ios/CodePush/SSZipArchive/minizip/mz_strm.c +0 -556
- package/ios/CodePush/SSZipArchive/minizip/mz_strm.h +0 -132
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_buf.c +0 -383
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_buf.h +0 -42
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_mem.c +0 -269
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_mem.h +0 -48
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_os.h +0 -40
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_os_posix.c +0 -203
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_pkcrypt.c +0 -334
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_pkcrypt.h +0 -46
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_split.c +0 -429
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_split.h +0 -43
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_wzaes.c +0 -360
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_wzaes.h +0 -46
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_zlib.c +0 -389
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_zlib.h +0 -43
- package/ios/CodePush/SSZipArchive/minizip/mz_zip.c +0 -2782
- package/ios/CodePush/SSZipArchive/minizip/mz_zip.h +0 -262
- package/ios/CodePush/SSZipArchive/minizip/mz_zip_rw.c +0 -1942
- package/ios/CodePush/SSZipArchive/minizip/mz_zip_rw.h +0 -285
- package/scripts/postlink/android/postlink.js +0 -87
- package/scripts/postlink/ios/postlink.js +0 -116
- package/scripts/postlink/run.js +0 -11
- package/scripts/postunlink/android/postunlink.js +0 -74
- package/scripts/postunlink/ios/postunlink.js +0 -87
- package/scripts/postunlink/run.js +0 -11
- package/scripts/tools/linkToolsAndroid.js +0 -57
- package/scripts/tools/linkToolsIos.js +0 -130
- package/windows-legacy/CodePush/CodePush.csproj +0 -128
- package/windows-legacy/CodePush/CodePushUtils.cs +0 -47
- package/windows-legacy/CodePush/FileUtils.cs +0 -40
- package/windows-legacy/CodePush/Properties/AssemblyInfo.cs +0 -29
- package/windows-legacy/CodePush/Properties/CodePush.rd.xml +0 -33
- package/windows-legacy/CodePush/UpdateManager.cs +0 -305
- package/windows-legacy/CodePush/UpdateUtils.cs +0 -46
- package/windows-legacy/CodePush.Net46/Adapters/Http/HttpProgress.cs +0 -28
- package/windows-legacy/CodePush.Net46/Adapters/Storage/ApplicationDataContainer.cs +0 -106
- package/windows-legacy/CodePush.Net46/CodePush.Net46.csproj +0 -103
- package/windows-legacy/CodePush.Net46/CodePushUtils.cs +0 -158
- package/windows-legacy/CodePush.Net46/FileUtils.cs +0 -55
- package/windows-legacy/CodePush.Net46/Properties/AssemblyInfo.cs +0 -36
- package/windows-legacy/CodePush.Net46/UpdateManager.cs +0 -330
- package/windows-legacy/CodePush.Net46/UpdateUtils.cs +0 -70
- package/windows-legacy/CodePush.Net46/packages.config +0 -5
- package/windows-legacy/CodePush.Net46.Test/ApplicationDataContainerTest.cs +0 -105
- package/windows-legacy/CodePush.Net46.Test/CodePush.Net46.Test.csproj +0 -137
- package/windows-legacy/CodePush.Net46.Test/Properties/AssemblyInfo.cs +0 -36
- package/windows-legacy/CodePush.Net46.Test/TelemetryManagerTest.cs +0 -117
- package/windows-legacy/CodePush.Net46.Test/app.config +0 -11
- package/windows-legacy/CodePush.Net46.Test/packages.config +0 -4
- package/windows-legacy/CodePush.Shared/CodePush.Shared.projitems +0 -22
- package/windows-legacy/CodePush.Shared/CodePush.Shared.shproj +0 -13
- package/windows-legacy/CodePush.Shared/CodePushConstants.cs +0 -35
- package/windows-legacy/CodePush.Shared/CodePushNativeModule.cs +0 -329
- package/windows-legacy/CodePush.Shared/CodePushReactPackage.cs +0 -235
- package/windows-legacy/CodePush.Shared/CodePushUtils.cs +0 -70
- package/windows-legacy/CodePush.Shared/InstallMode.cs +0 -9
- package/windows-legacy/CodePush.Shared/MinimumBackgroundListener.cs +0 -44
- package/windows-legacy/CodePush.Shared/SettingsManager.cs +0 -148
- package/windows-legacy/CodePush.Shared/TelemetryManager.cs +0 -250
- package/windows-legacy/CodePush.Shared/UpdateState.cs +0 -9
package/README.md
CHANGED
|
@@ -1,226 +1,173 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
#### [Sign up With App Center](https://appcenter.ms/signup?utm_source=CodePush&utm_medium=Azure) to use CodePush
|
|
4
|
-
|
|
5
|
-
# React Native Module for CodePush
|
|
6
|
-
> [!WARNING]
|
|
7
|
-
> React Native CodePush won't support new Architecture. In order to use this plugin on React Native versions starting from 0.76 you will need to [opt out](https://reactnative.dev/blog/2024/10/23/the-new-architecture-is-here#opt-out) from new architecture.
|
|
8
|
-
>
|
|
9
|
-
*Note: This README is only relevant to the latest version of our plugin. If you are using an older version, please switch to the relevant tag on [our GitHub repo](https://github.com/microsoft/react-native-code-push) to view the docs for that particular version.*
|
|
10
|
-
|
|
11
|
-

|
|
12
|
-
|
|
13
|
-
This plugin provides client-side integration for the [CodePush service](https://microsoft.github.io/code-push/), allowing you to easily add a dynamic update experience to your React Native app(s).
|
|
14
|
-
|
|
15
|
-
<!-- React Native Catalog -->
|
|
1
|
+
# React Native Module for AppZung CodePush
|
|
16
2
|
|
|
3
|
+
* [AppZung](#appzung)
|
|
17
4
|
* [How does it work?](#how-does-it-work)
|
|
18
|
-
* [
|
|
19
|
-
* [
|
|
20
|
-
* [
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
* [
|
|
25
|
-
|
|
26
|
-
* [Releasing
|
|
27
|
-
* [
|
|
28
|
-
* [Android](docs/multi-deployment-testing-android.md)
|
|
29
|
-
* [iOS](docs/multi-deployment-testing-ios.md)
|
|
30
|
-
* [Dynamic Deployment Assignment](#dynamic-deployment-assignment)
|
|
5
|
+
* [Getting started](#getting-started)
|
|
6
|
+
* [iOS Setup](docs/setup-ios.md)
|
|
7
|
+
* [Android Setup](docs/setup-android.md)
|
|
8
|
+
* [Windows Setup](docs/setup-windows.md)
|
|
9
|
+
* [Migrating to AppZung CodePush](#migrating-to-appzung-codepush)
|
|
10
|
+
* [Compatibility table](#compatibility-table)
|
|
11
|
+
* [Usage](#usage)
|
|
12
|
+
* [Advanced usage](./docs/advanced-usage.md)
|
|
13
|
+
* [Releasing updates](#releasing-updates)
|
|
14
|
+
* [Store guidelines compliance](#store-guidelines-compliance)
|
|
31
15
|
* [API Reference](#api-reference)
|
|
32
|
-
* [JavaScript API](docs/api-js.md)
|
|
33
|
-
* [Objective-C API Reference (iOS)](docs/api-ios.md)
|
|
34
|
-
* [Java API Reference (Android)](docs/api-android.md)
|
|
35
16
|
* [Debugging / Troubleshooting](#debugging--troubleshooting)
|
|
36
|
-
* [Example Apps / Starters](#example-apps--starters)
|
|
37
|
-
* [Continuous Integration / Delivery](#continuous-integration--delivery)
|
|
38
|
-
* [TypeScript Consumption](#typescript-consumption)
|
|
39
|
-
|
|
40
|
-
<!-- React Native Catalog -->
|
|
41
|
-
|
|
42
|
-
## How does it work?
|
|
43
|
-
|
|
44
|
-
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.
|
|
45
|
-
|
|
46
|
-
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!
|
|
47
17
|
|
|
48
|
-
|
|
18
|
+
## AppZung
|
|
49
19
|
|
|
50
|
-
|
|
20
|
+
AppZung is a robust solution for CodePush functionality, created in response to AppCenter's retirement.
|
|
21
|
+
CodePush allows you to easily add a dynamic update experience to your React Native app(s).
|
|
51
22
|
|
|
52
|
-
|
|
23
|
+
We will offer feature-parity with the original CodePush and introduce advanced capabilities in:
|
|
53
24
|
|
|
54
|
-
-
|
|
55
|
-
-
|
|
56
|
-
-
|
|
25
|
+
- Hosting
|
|
26
|
+
- Delivery
|
|
27
|
+
- Analytics
|
|
28
|
+
- Security
|
|
29
|
+
- Privacy
|
|
57
30
|
|
|
58
|
-
|
|
31
|
+
Currently, AppZung is used in production by several private clients, serving over 2M end-users.
|
|
59
32
|
|
|
60
|
-
|
|
61
|
-
|-------------------------|-------------------------------------------------------|
|
|
62
|
-
| <0.14 | **Unsupported** |
|
|
63
|
-
| v0.14 | v1.3 *(introduced Android support)* |
|
|
64
|
-
| v0.15-v0.18 | v1.4-v1.6 *(introduced iOS asset support)* |
|
|
65
|
-
| v0.19-v0.28 | v1.7-v1.17 *(introduced Android asset support)* |
|
|
66
|
-
| v0.29-v0.30 | v1.13-v1.17 *(RN refactored native hosting code)* |
|
|
67
|
-
| v0.31-v0.33 | v1.14.6-v1.17 *(RN refactored native hosting code)* |
|
|
68
|
-
| v0.34-v0.35 | v1.15-v1.17 *(RN refactored native hosting code)* |
|
|
69
|
-
| v0.36-v0.39 | v1.16-v1.17 *(RN refactored resume handler)* |
|
|
70
|
-
| v0.40-v0.42 | v1.17 *(RN refactored iOS header files)* |
|
|
71
|
-
| v0.43-v0.44 | v2.0+ *(RN refactored uimanager dependencies)* |
|
|
72
|
-
| v0.45 | v3.0+ *(RN refactored instance manager code)* |
|
|
73
|
-
| v0.46 | v4.0+ *(RN refactored js bundle loader code)* |
|
|
74
|
-
| v0.46-v0.53 | v5.1+ *(RN removed unused registration of JS modules)*|
|
|
75
|
-
| v0.54-v0.55 | v5.3+ *(Android Gradle Plugin 3.x integration)* |
|
|
76
|
-
| v0.56-v0.58 | v5.4+ *(RN upgraded versions for Android tools)* |
|
|
77
|
-
| v0.59 | v5.6+ *(RN refactored js bundle loader code)* |
|
|
78
|
-
| v0.60-v0.61 | v6.0+ *(RN migrated to Autolinking)* |
|
|
79
|
-
| v0.62-v0.64 | v6.2+ *(RN removed LiveReload)* |
|
|
80
|
-
| v0.65-v0.70 | v7.0+ *(RN updated iPhone-target-version)* |
|
|
81
|
-
| v0.71 | v8.0+ *(RN moved to react-native-gradle-plugin)* |
|
|
82
|
-
|
|
83
|
-
*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).*
|
|
33
|
+
AppZung may or may not expand the scope beyond CodePush features in the future.
|
|
84
34
|
|
|
85
|
-
|
|
35
|
+
It is not yet available publicly - Email hello@appzung.com to join the platform.
|
|
86
36
|
|
|
87
|
-
|
|
37
|
+
## How does it work?
|
|
88
38
|
|
|
89
|
-
|
|
39
|
+
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.
|
|
90
40
|
|
|
91
|
-
|
|
92
|
-
|-------------------------------------------------|------------------------------------------|
|
|
93
|
-
| `Image` | `source` |
|
|
94
|
-
| `MapView.Marker` <br />*(Requires [react-native-maps](https://github.com/lelandrichardson/react-native-maps) `>=O.3.2`)* | `image` |
|
|
95
|
-
| `ProgressViewIOS` | `progressImage`, `trackImage` |
|
|
96
|
-
| `TabBarIOS.Item` | `icon`, `selectedIcon` |
|
|
97
|
-
| `ToolbarAndroid` <br />*(React Native 0.21.0+)* | `actions[].icon`, `logo`, `overflowIcon` |
|
|
98
|
-
| `Video` | `source` |
|
|
41
|
+
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!
|
|
99
42
|
|
|
100
|
-
|
|
43
|
+
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 on the server. It's a win-win-win!
|
|
101
44
|
|
|
102
|
-
|
|
103
|
-
|-------------|----------------------------------------------------------------------|
|
|
104
|
-
| `SliderIOS` | `maximumTrackImage`, `minimumTrackImage`, `thumbImage`, `trackImage` |
|
|
105
|
-
| `Video` | `source` |
|
|
45
|
+
*Note: Any product changes which touch native code (e.g. modifying your `AppDelegate.mm`/`MainActivity.kt` file, adding a new plugin, or changing an image or video not using `require()` syntax) cannot be distributed via CodePush, and therefore, must be updated via the appropriate store(s).*
|
|
106
46
|
|
|
107
|
-
|
|
47
|
+
## Getting started
|
|
108
48
|
|
|
109
|
-
|
|
49
|
+
If you are migrating from `react-native-code-push`, see below ["Migrating to AppZung CodePush"](#migrating-to-appzung-codepush).
|
|
110
50
|
|
|
111
|
-
```
|
|
112
|
-
|
|
51
|
+
```shell
|
|
52
|
+
npm install --save @appzung/react-native-code-push
|
|
113
53
|
```
|
|
114
54
|
|
|
115
|
-
|
|
55
|
+
*NOTE: For Expo apps a plugin will be made available soon. In the meantime, you may eject.*
|
|
116
56
|
|
|
117
|
-
|
|
57
|
+
Then continue with installing the native module:
|
|
118
58
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
59
|
+
* [iOS Setup](docs/setup-ios.md)
|
|
60
|
+
* [Android Setup](docs/setup-android.md)
|
|
61
|
+
* [Windows Setup](docs/setup-windows.md)
|
|
122
62
|
|
|
123
|
-
|
|
63
|
+
## Migrating to AppZung CodePush
|
|
124
64
|
|
|
125
|
-
|
|
65
|
+
This `@appzung/react-native-code-push` package aims to be a drop-in replacement for the `react-native-code-push` module from Microsoft. You may find the migration steps below.
|
|
126
66
|
|
|
127
|
-
|
|
67
|
+
This package will be updated with new features, that will only be available on `@appzung/react-native-code-push` v10+ (not the original `react-native-code-push` module).
|
|
128
68
|
|
|
129
|
-
|
|
130
|
-
* [iOS Setup](docs/setup-ios.md)
|
|
131
|
-
* [Android Setup](docs/setup-android.md)
|
|
132
|
-
* [Windows Setup](docs/setup-windows.md)
|
|
69
|
+
This package is compatible with the new architecture on iOS (tested on 0.76) with the interop layer, but not yet on Android. We started some work, but we are not focusing on it right now since there is no demand from our private clients for the moment. Note that there is ongoing work by the community on the original `react-native-code-push` repository so we will be able to integrate this faster in case it gets finished.
|
|
133
70
|
|
|
71
|
+
Windows (UWP) won't be actively supported on v10+ except if there is demand for it (it will get stuck at the basic features of CodePush v9). Please contact hello@appzung.com to help us assess this demand. Thank you for your understanding.
|
|
134
72
|
|
|
135
|
-
|
|
73
|
+
We renamed "deployments" to "release channels" for better clarity between actual release deployments and their release channels.
|
|
136
74
|
|
|
137
|
-
|
|
75
|
+
### Migrating to AppZung CLI
|
|
138
76
|
|
|
139
|
-
1.
|
|
77
|
+
1. Use the AppZung CLI (`@appzung/cli`) instead of AppCenter's. See `npx @appzung/cli@1 welcome` and `npx @appzung/cli@1 --help`
|
|
78
|
+
2. Migrate your apps from AppCenter automatically in order to retain most of your config (project hierarchy, release channels public ID = deployment key...) using `npx @appzung/cli@1 codepush migrate`
|
|
79
|
+
3. Change your deployment process with `npx @appzung/cli@1 releases deploy-react-native` (see section ["Releasing Updates"](#releasing-updates) below)
|
|
140
80
|
|
|
141
|
-
|
|
81
|
+
### Migration steps to @appzung/react-native-code-push v7,v8,v9 or below
|
|
142
82
|
|
|
143
|
-
|
|
83
|
+
If your app does not meet the requirements of the last version of Microsoft's `react-native-code-push` (iOS 15.5, React Native 0.71+), from which this module is based on, you may still use old versions of `react-native-code-push` and specify `CodePushServerUrl` to `https://codepush.appzung.com`, as our API is compatible with the original module's features.
|
|
144
84
|
|
|
145
|
-
|
|
85
|
+
You may also use the versions that we published based on the versions v5-v9 with minimal changes:
|
|
146
86
|
|
|
147
|
-
|
|
87
|
+
1. Replace the `react-native-code-push` version with `npm:@appzung/react-native-code-push@9.0.2` (or 8.3.2, 7.1.1, 6.4.2, 6.3.1, 5.7.1) eg. `"react-native-code-push": "npm:@appzung/react-native-code-push@^8.3.2",`
|
|
88
|
+
2. Run `npm install` (or `yarn` depending on your project)
|
|
89
|
+
3. Run `bundle exec pod install`
|
|
90
|
+
4. That's it! In these versions you keep the old nomenclature DeploymentKey (vs new ReleaseChannelPublicId).
|
|
148
91
|
|
|
149
|
-
|
|
150
|
-
import codePush from "react-native-code-push";
|
|
92
|
+
### Migration steps to @appzung/react-native-code-push v10+
|
|
151
93
|
|
|
152
|
-
|
|
153
|
-
}
|
|
94
|
+
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.
|
|
154
95
|
|
|
155
|
-
|
|
156
|
-
```
|
|
96
|
+
#### Switch to @appzung/react-native-code-push npm package
|
|
157
97
|
|
|
158
|
-
|
|
98
|
+
1. Replace `react-native-code-push` in your package.json with `@appzung/react-native-code-push`: `@appzung/react-native-code-push: "^10.0.0"`
|
|
99
|
+
2. Run `npm install` (or `yarn` depending on your project)
|
|
159
100
|
|
|
160
|
-
|
|
161
|
-
import codePush from "react-native-code-push";
|
|
101
|
+
#### Change your JS code
|
|
162
102
|
|
|
163
|
-
|
|
164
|
-
|
|
103
|
+
1. Replace every `react-native-code-push` imports with `@appzung/react-native-code-push` imports
|
|
104
|
+
2. (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`
|
|
105
|
+
3. (optional) If you use dynamic deployment assignation, rename `deploymentKey` option to `releaseChannelPublicId` (TypeScript should catch that)
|
|
165
106
|
|
|
166
|
-
|
|
167
|
-
```
|
|
107
|
+
#### Change your iOS setup
|
|
168
108
|
|
|
169
|
-
|
|
109
|
+
1. Run `bundle exec pod install`
|
|
110
|
+
2. Rename `CodePushDeploymentKey` to `CodePushReleaseChannelPublicId` in your `Info.plist`
|
|
111
|
+
3. (optional) If you already use code signing, rename `CodePushPublicKey` to `CodePushSigningPublicKey` in your `Info.plist`
|
|
170
112
|
|
|
171
|
-
|
|
113
|
+
#### Change your Android setup
|
|
172
114
|
|
|
173
|
-
|
|
115
|
+
1. In `android/settings.gradle` change the lines about CodePush : `include ':appzung_react-native-code-push'` and `project(':appzung_react-native-code-push').projectDir = new File(rootProject.projectDir, '../node_modules/@appzung/react-native-code-push/android/app')`
|
|
116
|
+
2. In `android/app/build.gradle` change the line about CodePush: `apply from: "../../node_modules/@appzung/react-native-code-push/android/codepush.gradle"`
|
|
117
|
+
3. In your Android files (eg. `MainApplication.kt`), rename every `com.microsoft.codepush` prefix imports with `com.appzung.codepush`
|
|
118
|
+
4. Rename `CodePushDeploymentKey` to `CodePushReleaseChannelPublicId` in your strings resources (located either at strings.xml or app/build.gradle).
|
|
119
|
+
5. (optional) If you already use code signing, rename `CodePushPublicKey` to `CodePushSigningPublicKey` in your strings resources
|
|
174
120
|
|
|
175
|
-
|
|
176
|
-
import codePush from "react-native-code-push";
|
|
121
|
+
## Compatibility table
|
|
177
122
|
|
|
178
|
-
|
|
179
|
-
class MyApp extends Component {
|
|
180
|
-
}
|
|
181
|
-
```
|
|
123
|
+
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:
|
|
182
124
|
|
|
183
|
-
|
|
125
|
+
| React Native version(s) | Android | iOS | Supporting CodePush version(s) |
|
|
126
|
+
|-------------------------|-----------------|------|--------------------------------|
|
|
127
|
+
| <0.59 | - | - | **Unsupported** |
|
|
128
|
+
| v0.59 | 4.1+ (TLS 1.2+) | 7 | v5.7.1 |
|
|
129
|
+
| v0.60-v0.61 | 4.1+ (TLS 1.2+) | 7 | v6.3.1 |
|
|
130
|
+
| v0.62-v0.64 | 4.1+ (TLS 1.2+) | 7 | v6.4.2 |
|
|
131
|
+
| v0.65-v0.70 | 4.1+ (TLS 1.2+) | 9 | v7.1.1 |
|
|
132
|
+
| v0.71+ | 4.1+ (TLS 1.2+) | 9 | v8.3.2 |
|
|
133
|
+
| v0.71+ | 4.1+ (TLS 1.2+) | 15.5 | v9.0.2 or v10+ |
|
|
184
134
|
|
|
185
|
-
|
|
186
|
-
import codePush from "react-native-code-push";
|
|
135
|
+
Our plugin will support new architecture but for the moment starting from 0.76 you will need to [opt out](https://reactnative.dev/blog/2024/10/23/the-new-architecture-is-here#opt-out) from new architecture.
|
|
187
136
|
|
|
188
|
-
|
|
189
|
-
}
|
|
137
|
+
We work hard to respond to new RN releases, but they do occasionally break us. We will update this chart with each RN release, so that users can check to see what our "official" support is.
|
|
190
138
|
|
|
191
|
-
|
|
192
|
-
```
|
|
139
|
+
Windows (UWP) won't be actively supported on v10+ except if there is demand for it (it will get stuck at the basic features of CodePush v9). Please contact hello@appzung.com to help us assess this demand. Thank you for your understanding.
|
|
193
140
|
|
|
194
|
-
|
|
141
|
+
## Usage
|
|
195
142
|
|
|
196
|
-
|
|
143
|
+
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:
|
|
197
144
|
|
|
198
|
-
|
|
145
|
+
1. When (and how often) to check for an update? (for example app start, in response to clicking a button in a settings page, periodically at some fixed interval)
|
|
146
|
+
2. When an update is available, how to present it to the end user?
|
|
199
147
|
|
|
200
|
-
|
|
201
|
-
let codePushOptions = { checkFrequency: codePush.CheckFrequency.ON_APP_RESUME };
|
|
148
|
+
The simplest way to do this is to "CodePush-ify" your app's root component:
|
|
202
149
|
|
|
203
|
-
|
|
204
|
-
|
|
150
|
+
```javascript
|
|
151
|
+
import codePush from "@appzung/react-native-code-push";
|
|
205
152
|
|
|
206
|
-
|
|
207
|
-
|
|
153
|
+
const MyApp = () => {
|
|
154
|
+
}
|
|
208
155
|
|
|
209
|
-
|
|
156
|
+
export default codePush(MyApp);
|
|
157
|
+
```
|
|
210
158
|
|
|
211
|
-
|
|
212
|
-
let codePushOptions = { checkFrequency: codePush.CheckFrequency.ON_APP_RESUME };
|
|
159
|
+
By default, and this is recommended for production environments, CodePush will check for updates on every app start. If an update is available, it will be silently downloaded, and installed the next time the app is restarted (either explicitly by the end user or by the OS), which ensures the least invasive experience for your end users. If an available update is mandatory, then it will be installed immediately, ensuring that the end user gets it as soon as possible.
|
|
213
160
|
|
|
214
|
-
|
|
215
|
-
}
|
|
161
|
+
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.
|
|
216
162
|
|
|
217
|
-
|
|
218
|
-
|
|
163
|
+
```javascript
|
|
164
|
+
codePush({ checkFrequency: codePush.CheckFrequency.ON_APP_RESUME })(MyApp);
|
|
165
|
+
```
|
|
219
166
|
|
|
220
|
-
Alternatively, if you want fine-grained control over when the check happens (like a button press or timer interval), you can call [`CodePush.sync()`](docs/api-js.md#codepushsync) at any time with your desired `SyncOptions`, and
|
|
167
|
+
Alternatively, if you want fine-grained control over when the check happens (like a button press or timer interval), eg. in a staging environment, you can call [`CodePush.sync()`](docs/api-js.md#codepushsync) at any time with your desired `SyncOptions`, and turn off CodePush's automatic checking by specifying a manual `checkFrequency`:
|
|
221
168
|
|
|
222
169
|
```javascript
|
|
223
|
-
|
|
170
|
+
import codePush from "@appzung/react-native-code-push";
|
|
224
171
|
|
|
225
172
|
class MyApp extends Component {
|
|
226
173
|
onButtonPress() {
|
|
@@ -241,137 +188,88 @@ class MyApp extends Component {
|
|
|
241
188
|
}
|
|
242
189
|
}
|
|
243
190
|
|
|
244
|
-
|
|
191
|
+
export default codePush({ checkFrequency: codePush.CheckFrequency.MANUAL })(MyApp);
|
|
245
192
|
```
|
|
246
193
|
|
|
247
194
|
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.
|
|
248
195
|
|
|
249
|
-
|
|
196
|
+
## Releasing updates
|
|
250
197
|
|
|
251
|
-
|
|
198
|
+
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 `appzung releases deploy-react-native` command in the AppZung CLI, which will bundle your JavaScript files, asset files, and release the update to the CodePush server.
|
|
252
199
|
|
|
253
|
-
|
|
200
|
+
### Locally
|
|
254
201
|
|
|
255
|
-
|
|
202
|
+
*NOTE: Before you can start releasing updates, please log into AppZung by running the `appzung auth login` command.*
|
|
256
203
|
|
|
257
|
-
|
|
258
|
-
> 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).
|
|
259
|
-
|
|
260
|
-
That fully allow CodePush as it updates just JS bundles and can't update native code part.
|
|
261
|
-
|
|
262
|
-
#### App Store
|
|
263
|
-
|
|
264
|
-
Paragraph **3.3.2**, since back in 2015's [Apple Developer Program License Agreement](https://developer.apple.com/programs/ios/information/) fully allowed performing over-the-air updates of JavaScript and assets - and in its latest version (20170605) [downloadable here](https://developer.apple.com/terms/) this ruling is even broader:
|
|
265
|
-
|
|
266
|
-
> Interpreted code may be downloaded to an Application but only so long as such code: (a) does not change the primary purpose of the Application by providing features or functionality that are inconsistent with the intended and advertised purpose of the Application as submitted to the App Store, (b) does not create a store or storefront for other code or applications, and (c) does not bypass signing, sandbox, or other security features of the OS.
|
|
267
|
-
|
|
268
|
-
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.
|
|
269
|
-
|
|
270
|
-
To further remain in compliance with Apple's guidelines we suggest that App Store-distributed apps don't enable the `updateDialog` option when calling `sync`, since in the [App Store Review Guidelines](https://developer.apple.com/app-store/review/guidelines/) it is written that:
|
|
271
|
-
|
|
272
|
-
> Apps must not force users to rate the app, review the app, download other apps, or other similar actions in order to access functionality, content, or use of the app.
|
|
273
|
-
|
|
274
|
-
This is not necessarily the case for `updateDialog`, since it won't force the user to download the new version, but at least you should be aware of that ruling if you decide to show it.
|
|
275
|
-
|
|
276
|
-
## Releasing Updates
|
|
277
|
-
|
|
278
|
-
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.
|
|
279
|
-
|
|
280
|
-
*NOTE: Before you can start releasing updates, please log into App Center by running the `appcenter login` command.*
|
|
281
|
-
|
|
282
|
-
In its most basic form, this command only requires one parameter: your owner name + "/" + app name.
|
|
204
|
+
In its most basic form, this command looks like this:
|
|
283
205
|
|
|
284
206
|
```shell
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
appcenter codepush release-react -a <ownerName>/MyApp-iOS
|
|
288
|
-
appcenter codepush release-react -a <ownerName>/MyApp-Android
|
|
207
|
+
appzung releases deploy-react-native
|
|
289
208
|
```
|
|
290
209
|
|
|
291
|
-
The `
|
|
210
|
+
The `appzung releases deploy-react-native` command enables such a simple workflow because it provides many sensible defaults (like generating a release bundle, assuming your app's entry file on iOS is either `index.ios.js` or `index.js`). However, all of these defaults can be customized to allow incremental flexibility as necessary, which makes it a good fit for most scenarios. Here are common use-cases:
|
|
292
211
|
|
|
293
212
|
```shell
|
|
294
|
-
# Release a mandatory update with a changelog
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
# Release an update for an app that uses a non-standard entry file name, and also capture
|
|
298
|
-
# the sourcemap file generated by react-native bundle
|
|
299
|
-
appcenter codepush release-react -a <ownerName>/MyApp-iOS --entry-file MyApp.js --sourcemap-output ../maps/MyApp.map
|
|
213
|
+
# Release a mandatory update with a changelog from the last git commit (useful for staging releases)
|
|
214
|
+
appzung releases deploy-react-native -m --description-from-current-git-commit
|
|
300
215
|
|
|
301
|
-
#
|
|
302
|
-
|
|
216
|
+
# Force using hermes since auto-detection is not always possible. In a future version of the CLI use hermes will be enabled by default and there will be a --no-hermes flag instead.
|
|
217
|
+
appzung releases deploy-react-native --use-hermes
|
|
303
218
|
|
|
304
|
-
#
|
|
305
|
-
|
|
306
|
-
appcenter codepush release-react -a <ownerName>/MyApp-Android --target-binary-version "~1.1.0"
|
|
219
|
+
# Auto detecting the release version might not be a good strategy in a production app with multiple environments so you can specify the version
|
|
220
|
+
appzung releases deploy-react-native --target-binary-version "1.1.2"
|
|
307
221
|
|
|
222
|
+
# See other flags
|
|
223
|
+
appzung releases deploy-react-native --help
|
|
308
224
|
```
|
|
309
225
|
|
|
310
226
|
The CodePush client supports differential updates, so even though you are releasing your JS bundle and assets on every update, your end users will only actually download the files they need. The service handles this automatically so that you can focus on creating awesome apps and we can worry about optimizing end user downloads.
|
|
311
227
|
|
|
312
|
-
For more details about how the `
|
|
228
|
+
For more details about how the `appzung releases deploy-react-native` command works, as well as the various parameters it exposes, refer to the `appzung releases deploy-react-native --help` command. Additionally, if you would prefer to handle running the `react-native bundle` command yourself, and therefore, want an even more flexible solution than `appzung releases deploy-react-native`, refer to the `appzung releases deploy --help` command for more details.
|
|
313
229
|
|
|
314
|
-
If you run into any issues, or have any questions/comments/feedback, you can
|
|
230
|
+
If you run into any issues, or have any questions/comments/feedback, you can check out the [troubleshooting](#debugging--troubleshooting) details below or email us at support@appzung.com.
|
|
315
231
|
|
|
316
232
|
*NOTE: CodePush updates should be tested in modes other than Debug mode. In Debug mode, React Native app always downloads JS bundle generated by packager, so JS bundle downloaded by CodePush does not apply.*
|
|
317
233
|
|
|
318
|
-
###
|
|
319
|
-
|
|
320
|
-
In our [getting started](#getting-started) docs, we illustrated how to configure the CodePush plugin using a specific deployment key. However, in order to effectively test your releases, it is critical that you leverage the `Staging` and `Production` deployments that are auto-generated when you first created your CodePush app (or any custom deployments you may have created). This way, you never release an update to your end users that you haven't been able to validate yourself.
|
|
321
|
-
|
|
322
|
-
*NOTE: Our client-side rollback feature can help unblock users after installing a release that resulted in a crash, and server-side rollbacks (i.e. `appcenter codepush rollback`) allow you to prevent additional users from installing a bad release once it's been identified. However, it's obviously better if you can prevent an erroneous update from being broadly released in the first place.*
|
|
323
|
-
|
|
324
|
-
Taking advantage of the `Staging` and `Production` deployments allows you to achieve a workflow like the following (feel free to customize!):
|
|
234
|
+
### On CI
|
|
325
235
|
|
|
326
|
-
|
|
236
|
+
You would typically release updates in a CI though, so the command will need the release channel and a project secret API key that you previously create with `appzung projects api-keys create`.
|
|
327
237
|
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
4. Run your production/release build of your app, sync the update from the server and verify it works as expected
|
|
333
|
-
|
|
334
|
-
*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`.*
|
|
335
|
-
|
|
336
|
-
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:
|
|
238
|
+
```shell
|
|
239
|
+
appzung releases deploy-react-native --release-channel $APPZUNG_RELEASE_CHANNEL_ID_ANDROID --description-from-current-git-commit --use-hermes --disable-duplicate-release-error --api-key $APPZUNG_API_KEY
|
|
240
|
+
appzung releases deploy-react-native --release-channel $APPZUNG_RELEASE_CHANNEL_ID_IOS --description-from-current-git-commit --use-hermes --disable-duplicate-release-error --api-key $APPZUNG_API_KEY
|
|
241
|
+
```
|
|
337
242
|
|
|
338
|
-
|
|
339
|
-
* [iOS](docs/multi-deployment-testing-ios.md)
|
|
243
|
+
We will publish a guide with best practices and workflows examples for GitHub Actions and Bitrise.
|
|
340
244
|
|
|
245
|
+
### Advanced usage
|
|
341
246
|
|
|
342
|
-
|
|
247
|
+
See the corresponding documentation file about [Advanced usage](./docs/advanced-usage.md).
|
|
343
248
|
|
|
344
|
-
|
|
249
|
+
## Store guidelines compliance
|
|
345
250
|
|
|
346
|
-
|
|
251
|
+
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.
|
|
347
252
|
|
|
348
|
-
|
|
349
|
-
// Imagine that "userProfile" is a prop that this component received
|
|
350
|
-
// which includes the deployment key that the current user should use.
|
|
351
|
-
codePush.sync({ deploymentKey: userProfile.CODEPUSH_KEY });
|
|
352
|
-
```
|
|
253
|
+
### Google play
|
|
353
254
|
|
|
354
|
-
|
|
255
|
+
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.
|
|
256
|
+
> 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).
|
|
355
257
|
|
|
356
|
-
|
|
258
|
+
That fully allow CodePush as it updates just JS bundles and can't update native code part.
|
|
357
259
|
|
|
358
|
-
|
|
260
|
+
### App Store
|
|
359
261
|
|
|
360
|
-
|
|
262
|
+
Paragraph **3.3.2**, since back in 2015's [Apple Developer Program License Agreement](https://developer.apple.com/programs/ios/information/) fully allowed performing over-the-air updates of JavaScript and assets - and in its latest version (20170605) [downloadable here](https://developer.apple.com/terms/) this ruling is even broader:
|
|
361
263
|
|
|
362
|
-
|
|
264
|
+
> Interpreted code may be downloaded to an Application but only so long as such code: (a) does not change the primary purpose of the Application by providing features or functionality that are inconsistent with the intended and advertised purpose of the Application as submitted to the App Store, (b) does not create a store or storefront for other code or applications, and (c) does not bypass signing, sandbox, or other security features of the OS.
|
|
363
265
|
|
|
364
|
-
|
|
365
|
-
// #1) Create your new deployment to hold releases of a specific app variant
|
|
366
|
-
appcenter codepush deployment add -a <ownerName>/<appName> test-variant-one
|
|
266
|
+
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.
|
|
367
267
|
|
|
368
|
-
|
|
369
|
-
appcenter codepush release-react -a <ownerName>/<appName> -d test-variant-one
|
|
370
|
-
```
|
|
268
|
+
To further remain in compliance with Apple's guidelines we suggest that App Store-distributed apps don't enable the `updateDialog` option when calling `sync`, since in the [App Store Review Guidelines](https://developer.apple.com/app-store/review/guidelines/) it is written that:
|
|
371
269
|
|
|
372
|
-
|
|
270
|
+
> Apps must not force users to rate the app, review the app, download other apps, or other similar actions in order to access functionality, content, or use of the app.
|
|
373
271
|
|
|
374
|
-
|
|
272
|
+
This is not necessarily the case for `updateDialog`, since it won't force the user to download the new version, but at least you should be aware of that ruling if you decide to show it.
|
|
375
273
|
|
|
376
274
|
## API Reference
|
|
377
275
|
|
|
@@ -379,34 +277,15 @@ appcenter codepush release-react -a <ownerName>/<appName> -d test-variant-one
|
|
|
379
277
|
* [Objective-C API Reference (iOS)](docs/api-ios.md)
|
|
380
278
|
* [Java API Reference (Android)](docs/api-android.md)
|
|
381
279
|
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
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:
|
|
385
|
-
|
|
386
|
-
* [F8 App](https://github.com/fbsamples/f8app) - The official conference app for [F8 2016](https://www.fbf8.com/).
|
|
387
|
-
* [Feline for Product Hunt](https://github.com/arjunkomath/Feline-for-Product-Hunt) - An Android client for Product Hunt.
|
|
388
|
-
* [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.
|
|
389
|
-
* [Math Facts](https://github.com/Khan/math-facts) - An app by Khan Academy to help memorize math facts more easily.
|
|
280
|
+
## Debugging / Troubleshooting
|
|
390
281
|
|
|
391
|
-
|
|
282
|
+
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 release channel public ID?), 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:support@appzung.com) if you find it to be confusing or missing anything.
|
|
392
283
|
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
*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!*
|
|
396
|
-
|
|
397
|
-
### Debugging / Troubleshooting
|
|
398
|
-
|
|
399
|
-
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.
|
|
400
|
-
|
|
401
|
-
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.
|
|
402
|
-
|
|
403
|
-
<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">
|
|
404
|
-
|
|
405
|
-
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]`.
|
|
284
|
+
Start up the Chrome DevTools Console, the Xcode Console (iOS) and/or ADB logcat (Android), and look for messages which are prefixed with `[CodePush]`.
|
|
406
285
|
|
|
407
286
|
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:
|
|
408
287
|
|
|
409
|
-
1. Add an `#import <React/RCTLog.h>` statement
|
|
288
|
+
1. Add an `#import <React/RCTLog.h>` statement
|
|
410
289
|
|
|
411
290
|
2. Add the following statement to the top of your `application:didFinishLaunchingWithOptions` method:
|
|
412
291
|
|
|
@@ -416,30 +295,12 @@ Note that by default, React Native logs are disabled on iOS in release builds, s
|
|
|
416
295
|
|
|
417
296
|
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:
|
|
418
297
|
|
|
419
|
-
| Issue / Symptom
|
|
420
|
-
|
|
421
|
-
| Compilation Error
|
|
422
|
-
| Network timeout / hang when calling `sync` or `checkForUpdate` in the iOS Simulator
|
|
423
|
-
| Server responds with a `404` when calling `sync` or `checkForUpdate`
|
|
424
|
-
| Update not being discovered
|
|
425
|
-
| Update not being displayed after restart
|
|
426
|
-
| I've released an update for iOS but my Android app also shows an update and it breaks it | Be sure you have different
|
|
427
|
-
| I've released new update but changes are not reflected
|
|
428
|
-
| 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.
|
|
429
|
-
|
|
430
|
-
### Continuous Integration / Delivery
|
|
431
|
-
|
|
432
|
-
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:
|
|
433
|
-
|
|
434
|
-
* [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.*
|
|
435
|
-
* [Travis CI](https://github.com/mondora/code-push-travis-cli)
|
|
436
|
-
|
|
437
|
-
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/).
|
|
438
|
-
|
|
439
|
-
### TypeScript Consumption
|
|
440
|
-
|
|
441
|
-
This module ships its `*.d.ts` file as part of its NPM package, which allows you to simply `import` it, and receive intellisense in supporting editors (like Visual Studio Code), as well as compile-time type checking if you're using TypeScript. For the most part, this behavior should just work out of the box, however, if you've specified `es6` as the value for either the `target` or `module` [compiler option](http://www.typescriptlang.org/docs/handbook/compiler-options.html) in your [`tsconfig.json`](http://www.typescriptlang.org/docs/handbook/tsconfig-json.html) file, then just make sure that you also set the `moduleResolution` option to `node`. This ensures that the TypeScript compiler will look within the `node_modules` for the type definitions of imported modules. Otherwise, you'll get an error like the following when trying to import the `react-native-code-push` module: `error TS2307: Cannot find module 'react-native-code-push'`.
|
|
442
|
-
|
|
443
|
-
---
|
|
444
|
-
|
|
445
|
-
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
|
|
298
|
+
| Issue / Symptom | Possible Solution |
|
|
299
|
+
|------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
300
|
+
| Compilation Error | Double-check that your version of React Native is [compatible](#compatibility-table) with the CodePush version you are using. |
|
|
301
|
+
| 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. |
|
|
302
|
+
| Server responds with a `404` when calling `sync` or `checkForUpdate` | Double-check that the release channel public ID you added to your `Info.plist` (iOS), `strings.xml` or `app/build.gradle` (Android) or that you're passing to `sync`/`checkForUpdate`, is in fact correct. You can run `appzung release-channels list` to view the correct public ID for your app release channel. |
|
|
303
|
+
| 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 release channel that your app is configured to sync with. |
|
|
304
|
+
| 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. |
|
|
305
|
+
| I've released an update for iOS but my Android app also shows an update and it breaks it | Be sure you have different release channels for each platform in order to receive updates correctly |
|
|
306
|
+
| 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. |
|