@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.
Files changed (191) hide show
  1. package/CodePush.js +22 -19
  2. package/LICENSE.md +1 -1
  3. package/README.md +159 -298
  4. package/android/app/.gradle/config.properties +2 -0
  5. package/android/app/build.gradle +1 -1
  6. package/android/app/local.properties +8 -0
  7. package/android/app/src/main/java/com/microsoft/codepush/react/CodePush.java +27 -21
  8. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushBuilder.java +5 -5
  9. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushConstants.java +1 -1
  10. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushDialog.java +1 -1
  11. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushInstallMode.java +2 -2
  12. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushInvalidPublicKeyException.java +2 -2
  13. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushInvalidUpdateException.java +1 -1
  14. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushMalformedDataException.java +2 -2
  15. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushNativeModule.java +5 -5
  16. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushNotInitializedException.java +2 -2
  17. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushTelemetryManager.java +14 -14
  18. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushUnknownException.java +2 -2
  19. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushUpdateManager.java +1 -1
  20. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushUpdateState.java +2 -2
  21. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushUpdateUtils.java +1 -1
  22. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushUtils.java +1 -1
  23. package/android/app/src/main/java/com/microsoft/codepush/react/DownloadProgress.java +1 -1
  24. package/android/app/src/main/java/com/microsoft/codepush/react/DownloadProgressCallback.java +1 -1
  25. package/android/app/src/main/java/com/microsoft/codepush/react/FileUtils.java +1 -1
  26. package/android/app/src/main/java/com/microsoft/codepush/react/ReactInstanceHolder.java +1 -1
  27. package/android/app/src/main/java/com/microsoft/codepush/react/SettingsManager.java +1 -1
  28. package/android/app/src/main/java/com/microsoft/codepush/react/TLSSocketFactory.java +1 -1
  29. package/android/build.gradle +1 -1
  30. package/android/codepush.gradle +3 -3
  31. package/docs/advanced-usage.md +56 -0
  32. package/docs/api-android.md +12 -75
  33. package/docs/api-ios.md +5 -17
  34. package/docs/api-js.md +18 -55
  35. package/docs/setup-android.md +15 -397
  36. package/docs/setup-ios.md +24 -198
  37. package/docs/setup-windows.md +7 -74
  38. package/ios/CodePush/CodePush.h +4 -4
  39. package/ios/CodePush/CodePush.m +8 -8
  40. package/ios/CodePush/CodePushConfig.m +14 -11
  41. package/ios/CodePush/CodePushPackage.m +60 -60
  42. package/ios/CodePush/CodePushTelemetryManager.m +13 -13
  43. package/ios/CodePush.xcodeproj/project.pbxproj +1 -562
  44. package/package.json +27 -24
  45. package/react-native.config.js +1 -1
  46. package/scripts/generateBundledResourcesHash.js +1 -1
  47. package/scripts/getFilesInFolder.js +1 -1
  48. package/scripts/recordFilesBeforeBundleCommand.js +1 -1
  49. package/typings/react-native-code-push.d.ts +22 -22
  50. package/windows/CodePush/CodePushConfig.cpp +3 -3
  51. package/windows/CodePush/CodePushConfig.h +3 -3
  52. package/windows/CodePush/CodePushNativeModule.cpp +27 -27
  53. package/windows/CodePush/CodePushNativeModule.h +4 -4
  54. package/windows/CodePush/CodePushTelemetryManager.cpp +12 -12
  55. package/windows/CodePush/CodePushTelemetryManager.h +1 -1
  56. package/.azurepipelines/build-rn-code-push-1es.yml +0 -104
  57. package/.azurepipelines/test-rn-code-push.yml +0 -94
  58. package/.config/CredScanSuppressions.json +0 -14
  59. package/SECURITY.md +0 -41
  60. package/docs/multi-deployment-testing-android.md +0 -148
  61. package/docs/multi-deployment-testing-ios.md +0 -59
  62. package/ios/CodePush/Base64/Base64/MF_Base64Additions.h +0 -34
  63. package/ios/CodePush/Base64/Base64/MF_Base64Additions.m +0 -252
  64. package/ios/CodePush/Base64/README.md +0 -47
  65. package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithm.h +0 -69
  66. package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmFactory.h +0 -16
  67. package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmFactory.m +0 -51
  68. package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmNone.h +0 -15
  69. package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmNone.m +0 -55
  70. package/ios/CodePush/JWT/Core/Algorithms/ESFamily/JWTAlgorithmESBase.h +0 -24
  71. package/ios/CodePush/JWT/Core/Algorithms/ESFamily/JWTAlgorithmESBase.m +0 -41
  72. package/ios/CodePush/JWT/Core/Algorithms/HSFamily/JWTAlgorithmHSBase.h +0 -28
  73. package/ios/CodePush/JWT/Core/Algorithms/HSFamily/JWTAlgorithmHSBase.m +0 -205
  74. package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolder.h +0 -103
  75. package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolder.m +0 -322
  76. package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolderChain.h +0 -37
  77. package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolderChain.m +0 -145
  78. package/ios/CodePush/JWT/Core/Algorithms/RSFamily/JWTAlgorithmRSBase.h +0 -35
  79. package/ios/CodePush/JWT/Core/Algorithms/RSFamily/JWTAlgorithmRSBase.m +0 -551
  80. package/ios/CodePush/JWT/Core/Algorithms/RSFamily/JWTRSAlgorithm.h +0 -23
  81. package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKey.h +0 -43
  82. package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKey.m +0 -230
  83. package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKeyExtractor.h +0 -31
  84. package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKeyExtractor.m +0 -113
  85. package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoSecurity.h +0 -38
  86. package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoSecurity.m +0 -500
  87. package/ios/CodePush/JWT/Core/ClaimSet/JWTClaim.h +0 -18
  88. package/ios/CodePush/JWT/Core/ClaimSet/JWTClaim.m +0 -214
  89. package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSet.h +0 -23
  90. package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSet.m +0 -29
  91. package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetSerializer.h +0 -19
  92. package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetSerializer.m +0 -68
  93. package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetVerifier.h +0 -18
  94. package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetVerifier.m +0 -72
  95. package/ios/CodePush/JWT/Core/Coding/JWTCoding+ResultTypes.h +0 -67
  96. package/ios/CodePush/JWT/Core/Coding/JWTCoding+ResultTypes.m +0 -111
  97. package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionOne.h +0 -119
  98. package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionOne.m +0 -307
  99. package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionThree.h +0 -94
  100. package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionThree.m +0 -619
  101. package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionTwo.h +0 -164
  102. package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionTwo.m +0 -514
  103. package/ios/CodePush/JWT/Core/Coding/JWTCoding.h +0 -24
  104. package/ios/CodePush/JWT/Core/Coding/JWTCoding.m +0 -11
  105. package/ios/CodePush/JWT/Core/FrameworkSupplement/JWT.h +0 -52
  106. package/ios/CodePush/JWT/Core/FrameworkSupplement/Map.modulemap +0 -5
  107. package/ios/CodePush/JWT/Core/Supplement/JWTBase64Coder.h +0 -28
  108. package/ios/CodePush/JWT/Core/Supplement/JWTBase64Coder.m +0 -70
  109. package/ios/CodePush/JWT/Core/Supplement/JWTDeprecations.h +0 -22
  110. package/ios/CodePush/JWT/Core/Supplement/JWTErrorDescription.h +0 -34
  111. package/ios/CodePush/JWT/Core/Supplement/JWTErrorDescription.m +0 -73
  112. package/ios/CodePush/JWT/LICENSE +0 -19
  113. package/ios/CodePush/JWT/README.md +0 -489
  114. package/ios/CodePush/SSZipArchive/Info.plist +0 -26
  115. package/ios/CodePush/SSZipArchive/README.md +0 -1
  116. package/ios/CodePush/SSZipArchive/SSZipArchive.h +0 -178
  117. package/ios/CodePush/SSZipArchive/SSZipArchive.m +0 -1496
  118. package/ios/CodePush/SSZipArchive/SSZipCommon.h +0 -71
  119. package/ios/CodePush/SSZipArchive/Supporting Files/PrivacyInfo.xcprivacy +0 -23
  120. package/ios/CodePush/SSZipArchive/include/ZipArchive.h +0 -25
  121. package/ios/CodePush/SSZipArchive/minizip/LICENSE +0 -17
  122. package/ios/CodePush/SSZipArchive/minizip/mz.h +0 -273
  123. package/ios/CodePush/SSZipArchive/minizip/mz_compat.c +0 -1306
  124. package/ios/CodePush/SSZipArchive/minizip/mz_compat.h +0 -346
  125. package/ios/CodePush/SSZipArchive/minizip/mz_crypt.c +0 -187
  126. package/ios/CodePush/SSZipArchive/minizip/mz_crypt.h +0 -65
  127. package/ios/CodePush/SSZipArchive/minizip/mz_crypt_apple.c +0 -526
  128. package/ios/CodePush/SSZipArchive/minizip/mz_os.c +0 -348
  129. package/ios/CodePush/SSZipArchive/minizip/mz_os.h +0 -176
  130. package/ios/CodePush/SSZipArchive/minizip/mz_os_posix.c +0 -350
  131. package/ios/CodePush/SSZipArchive/minizip/mz_strm.c +0 -556
  132. package/ios/CodePush/SSZipArchive/minizip/mz_strm.h +0 -132
  133. package/ios/CodePush/SSZipArchive/minizip/mz_strm_buf.c +0 -383
  134. package/ios/CodePush/SSZipArchive/minizip/mz_strm_buf.h +0 -42
  135. package/ios/CodePush/SSZipArchive/minizip/mz_strm_mem.c +0 -269
  136. package/ios/CodePush/SSZipArchive/minizip/mz_strm_mem.h +0 -48
  137. package/ios/CodePush/SSZipArchive/minizip/mz_strm_os.h +0 -40
  138. package/ios/CodePush/SSZipArchive/minizip/mz_strm_os_posix.c +0 -203
  139. package/ios/CodePush/SSZipArchive/minizip/mz_strm_pkcrypt.c +0 -334
  140. package/ios/CodePush/SSZipArchive/minizip/mz_strm_pkcrypt.h +0 -46
  141. package/ios/CodePush/SSZipArchive/minizip/mz_strm_split.c +0 -429
  142. package/ios/CodePush/SSZipArchive/minizip/mz_strm_split.h +0 -43
  143. package/ios/CodePush/SSZipArchive/minizip/mz_strm_wzaes.c +0 -360
  144. package/ios/CodePush/SSZipArchive/minizip/mz_strm_wzaes.h +0 -46
  145. package/ios/CodePush/SSZipArchive/minizip/mz_strm_zlib.c +0 -389
  146. package/ios/CodePush/SSZipArchive/minizip/mz_strm_zlib.h +0 -43
  147. package/ios/CodePush/SSZipArchive/minizip/mz_zip.c +0 -2782
  148. package/ios/CodePush/SSZipArchive/minizip/mz_zip.h +0 -262
  149. package/ios/CodePush/SSZipArchive/minizip/mz_zip_rw.c +0 -1942
  150. package/ios/CodePush/SSZipArchive/minizip/mz_zip_rw.h +0 -285
  151. package/scripts/postlink/android/postlink.js +0 -87
  152. package/scripts/postlink/ios/postlink.js +0 -116
  153. package/scripts/postlink/run.js +0 -11
  154. package/scripts/postunlink/android/postunlink.js +0 -74
  155. package/scripts/postunlink/ios/postunlink.js +0 -87
  156. package/scripts/postunlink/run.js +0 -11
  157. package/scripts/tools/linkToolsAndroid.js +0 -57
  158. package/scripts/tools/linkToolsIos.js +0 -130
  159. package/windows-legacy/CodePush/CodePush.csproj +0 -128
  160. package/windows-legacy/CodePush/CodePushUtils.cs +0 -47
  161. package/windows-legacy/CodePush/FileUtils.cs +0 -40
  162. package/windows-legacy/CodePush/Properties/AssemblyInfo.cs +0 -29
  163. package/windows-legacy/CodePush/Properties/CodePush.rd.xml +0 -33
  164. package/windows-legacy/CodePush/UpdateManager.cs +0 -305
  165. package/windows-legacy/CodePush/UpdateUtils.cs +0 -46
  166. package/windows-legacy/CodePush.Net46/Adapters/Http/HttpProgress.cs +0 -28
  167. package/windows-legacy/CodePush.Net46/Adapters/Storage/ApplicationDataContainer.cs +0 -106
  168. package/windows-legacy/CodePush.Net46/CodePush.Net46.csproj +0 -103
  169. package/windows-legacy/CodePush.Net46/CodePushUtils.cs +0 -158
  170. package/windows-legacy/CodePush.Net46/FileUtils.cs +0 -55
  171. package/windows-legacy/CodePush.Net46/Properties/AssemblyInfo.cs +0 -36
  172. package/windows-legacy/CodePush.Net46/UpdateManager.cs +0 -330
  173. package/windows-legacy/CodePush.Net46/UpdateUtils.cs +0 -70
  174. package/windows-legacy/CodePush.Net46/packages.config +0 -5
  175. package/windows-legacy/CodePush.Net46.Test/ApplicationDataContainerTest.cs +0 -105
  176. package/windows-legacy/CodePush.Net46.Test/CodePush.Net46.Test.csproj +0 -137
  177. package/windows-legacy/CodePush.Net46.Test/Properties/AssemblyInfo.cs +0 -36
  178. package/windows-legacy/CodePush.Net46.Test/TelemetryManagerTest.cs +0 -117
  179. package/windows-legacy/CodePush.Net46.Test/app.config +0 -11
  180. package/windows-legacy/CodePush.Net46.Test/packages.config +0 -4
  181. package/windows-legacy/CodePush.Shared/CodePush.Shared.projitems +0 -22
  182. package/windows-legacy/CodePush.Shared/CodePush.Shared.shproj +0 -13
  183. package/windows-legacy/CodePush.Shared/CodePushConstants.cs +0 -35
  184. package/windows-legacy/CodePush.Shared/CodePushNativeModule.cs +0 -329
  185. package/windows-legacy/CodePush.Shared/CodePushReactPackage.cs +0 -235
  186. package/windows-legacy/CodePush.Shared/CodePushUtils.cs +0 -70
  187. package/windows-legacy/CodePush.Shared/InstallMode.cs +0 -9
  188. package/windows-legacy/CodePush.Shared/MinimumBackgroundListener.cs +0 -44
  189. package/windows-legacy/CodePush.Shared/SettingsManager.cs +0 -148
  190. package/windows-legacy/CodePush.Shared/TelemetryManager.cs +0 -250
  191. package/windows-legacy/CodePush.Shared/UpdateState.cs +0 -9
package/README.md CHANGED
@@ -1,226 +1,173 @@
1
- [![appcenterbanner](https://user-images.githubusercontent.com/31293287/32969262-3cc5d48a-cb99-11e7-91bf-fa57c67a371c.png)](http://microsoft.github.io/code-push/)
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
- ![Switching tags](https://user-images.githubusercontent.com/42337914/57237511-0835de80-7030-11e9-88fa-64eb200478d0.png)
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
- * [Supported React Native Platforms](#supported-react-native-platforms)
19
- * [Supported Components](#supported-components)
20
- * [Getting Started](#getting-started)
21
- * [iOS Setup](docs/setup-ios.md)
22
- * [Android Setup](docs/setup-android.md)
23
- * [Windows Setup](docs/setup-windows.md)
24
- * [Plugin Usage](#plugin-usage)
25
- * [Store Guideline Compliance](#store-guideline-compliance)
26
- * [Releasing Updates](#releasing-updates)
27
- * [Multi-Deployment Testing](#multi-deployment-testing)
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
- 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!
18
+ ## AppZung
49
19
 
50
- *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).*
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
- ## Supported React Native platforms
23
+ We will offer feature-parity with the original CodePush and introduce advanced capabilities in:
53
24
 
54
- - iOS (7+)
55
- - Android (4.1+) on TLS 1.2 compatible devices
56
- - Windows (UWP)
25
+ - Hosting
26
+ - Delivery
27
+ - Analytics
28
+ - Security
29
+ - Privacy
57
30
 
58
- 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:
31
+ Currently, AppZung is used in production by several private clients, serving over 2M end-users.
59
32
 
60
- | React Native version(s) | Supporting CodePush version(s) |
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
- 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.
35
+ It is not yet available publicly - Email hello@appzung.com to join the platform.
86
36
 
87
- ### Supported Components
37
+ ## How does it work?
88
38
 
89
- When using the React Native assets system (i.e. using the `require("./foo.png")` syntax), the following list represents the set of core components (and props) that support having their referenced images and videos updated via CodePush:
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
- | Component | Prop(s) |
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
- The following list represents the set of components (and props) that don't currently support their assets being updated via CodePush, due to their dependency on static images and videos (i.e. using the `{ uri: "foo" }` syntax):
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
- | Component | Prop(s) |
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
- 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.
47
+ ## Getting started
108
48
 
109
- *Note: CodePush only works with Video components when using `require` in the source prop. For example:*
49
+ If you are migrating from `react-native-code-push`, see below ["Migrating to AppZung CodePush"](#migrating-to-appzung-codepush).
110
50
 
111
- ```javascript
112
- <Video source={require("./foo.mp4")} />
51
+ ```shell
52
+ npm install --save @appzung/react-native-code-push
113
53
  ```
114
54
 
115
- ## Getting Started
55
+ *NOTE: For Expo apps a plugin will be made available soon. In the meantime, you may eject.*
116
56
 
117
- Once you've followed the general-purpose ["getting started"](https://docs.microsoft.com/en-us/appcenter/distribution/codepush/index) instructions for setting up your CodePush account, you can start CodePush-ifying your React Native app by running the following command from within your app's root directory:
57
+ Then continue with installing the native module:
118
58
 
119
- ```shell
120
- npm install --save react-native-code-push
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
- As with all other React Native plugins, the integration experience is different for iOS and Android, so perform the following setup steps depending on which platform(s) you are targeting. Note, if you are targeting both platforms it is recommended to create separate CodePush applications for each platform.
63
+ ## Migrating to AppZung CodePush
124
64
 
125
- 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).
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
- *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.*
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
- Then continue with installing the native module
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
- ## Plugin Usage
73
+ We renamed "deployments" to "release channels" for better clarity between actual release deployments and their release channels.
136
74
 
137
- 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:
75
+ ### Migrating to AppZung CLI
138
76
 
139
- 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)
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
- 2. When an update is available, how to present it to the end user?
81
+ ### Migration steps to @appzung/react-native-code-push v7,v8,v9 or below
142
82
 
143
- The simplest way to do this is to "CodePush-ify" your app's root component. To do so, you can choose one of the following two options:
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
- * **Option 1: Wrap your root component with the `codePush` higher-order component:**
85
+ You may also use the versions that we published based on the versions v5-v9 with minimal changes:
146
86
 
147
- * For class component
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
- ```javascript
150
- import codePush from "react-native-code-push";
92
+ ### Migration steps to @appzung/react-native-code-push v10+
151
93
 
152
- class MyApp extends Component {
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
- MyApp = codePush(MyApp);
156
- ```
96
+ #### Switch to @appzung/react-native-code-push npm package
157
97
 
158
- * For functional component
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
- ```javascript
161
- import codePush from "react-native-code-push";
101
+ #### Change your JS code
162
102
 
163
- let MyApp: () => React$Node = () => {
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
- MyApp = codePush(MyApp);
167
- ```
107
+ #### Change your iOS setup
168
108
 
169
- * **Option 2: Use the [ES7 decorator](https://github.com/wycats/javascript-decorators) syntax:**
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
- *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).
113
+ #### Change your Android setup
172
114
 
173
- * For class component
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
- ```javascript
176
- import codePush from "react-native-code-push";
121
+ ## Compatibility table
177
122
 
178
- @codePush
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
- * For functional component
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
- ```javascript
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
- const MyApp: () => React$Node = () => {
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
- export default codePush(MyApp);
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
- By default, 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.
141
+ ## Usage
195
142
 
196
- 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.
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
- * For class component
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
- ```javascript
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
- class MyApp extends Component {
204
- }
150
+ ```javascript
151
+ import codePush from "@appzung/react-native-code-push";
205
152
 
206
- MyApp = codePush(codePushOptions)(MyApp);
207
- ```
153
+ const MyApp = () => {
154
+ }
208
155
 
209
- * For functional component
156
+ export default codePush(MyApp);
157
+ ```
210
158
 
211
- ```javascript
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
- let MyApp: () => React$Node = () => {
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
- MyApp = codePush(codePushOptions)(MyApp);
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 optionally turn off CodePush's automatic checking by specifying a manual `checkFrequency`:
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
- let codePushOptions = { checkFrequency: codePush.CheckFrequency.MANUAL };
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
- MyApp = codePush(codePushOptions)(MyApp);
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
- *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.*
196
+ ## Releasing updates
250
197
 
251
- ### Store Guideline Compliance
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
- 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.
200
+ ### Locally
254
201
 
255
- #### Google play
202
+ *NOTE: Before you can start releasing updates, please log into AppZung by running the `appzung auth login` command.*
256
203
 
257
- 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.
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
- appcenter codepush release-react -a <ownerName>/<appName>
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 `release-react` 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.
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
- appcenter codepush release-react -a <ownerName>/MyApp-iOS -m --description "Modified the header color"
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
- # Release a dev Android build to just 1/4 of your end users
302
- appcenter codepush release-react -a <ownerName>/MyApp-Android --rollout 25 --development true
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
- # Release an update that targets users running any 1.1.* binary, as opposed to
305
- # limiting the update to exact version name in the build.gradle file
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 `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.
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 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.
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
- ### Multi-Deployment Testing
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
- 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)
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
- 2. Run your staging/beta build of your app, sync the update from the server, and verify it works as expected
329
-
330
- 3. Promote the tested release from `Staging` to `Production` using the `appcenter codepush promote` command
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
- * [Android](docs/multi-deployment-testing-android.md)
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
- ### Dynamic Deployment Assignment
247
+ See the corresponding documentation file about [Advanced usage](./docs/advanced-usage.md).
343
248
 
344
- 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.
249
+ ## Store guidelines compliance
345
250
 
346
- 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.
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
- ```javascript
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
- With that change in place, now it's just a matter of choosing how your app determines the right deployment key for the current user. In practice, there are typically two solutions for this:
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
- 1. Expose a user-visible mechanism for changing deployments at any time. For example, your settings page could have a toggle for enabling "beta" access. This model works well if you're not concerned with the privacy of your pre-production updates, and you have power users that may want to opt-in to earlier (and potentially buggy) updates at their own will (kind of like Chrome channels). However, this solution puts the decision in the hands of your users, which doesn't help you perform A/B tests transparently.
258
+ That fully allow CodePush as it updates just JS bundles and can't update native code part.
357
259
 
358
- 2. Annotate the server-side profile of your users with an additional piece of metadata that indicates the deployment they should sync with. By default, your app could just use the binary-embedded key, but after a user has authenticated, your server can choose to "redirect" them to a different deployment, which allows you to incrementally place certain users or groups in different deployments as needed. You could even choose to store the server-response in local storage so that it becomes the new default. How you store the key alongside your user's profiles is entirely up to your authentication solution (for example Auth0, Firebase, custom DB + REST API), but is generally pretty trivial to do.
260
+ ### App Store
359
261
 
360
- *NOTE: If needed, you could also implement a hybrid solution that allowed your end-users to toggle between different deployments, while also allowing your server to override that decision. This way, you have a hierarchy of "deployment resolution" that ensures your app has the ability to update itself out-of-the-box, your end users can feel rewarded by getting early access to bits, but you also have the ability to run A/B tests on your users as needed.*
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
- Since we recommend using the `Staging` deployment for pre-release testing of your updates (as explained in the previous section), it doesn't neccessarily make sense to use it for performing A/B tests on your users, as opposed to allowing early-access (as explained in option #1 above). Therefore, we recommend making full use of custom app deployments, so that you can segment your users however makes sense for your needs. For example, you could create long-term or even one-off deployments, release a variant of your app to it, and then place certain users into it in order to see how they engage.
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
- ```javascript
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
- // #2) Target any new releases at that custom deployment
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
- *NOTE: The total user count that is reported in your deployment's "Install Metrics" will take into account users that have "switched" from one deployment to another. For example, if your `Production` deployment currently reports having 1 total user, but you dynamically switch that user to `Staging`, then the `Production` deployment would report 0 total users, while `Staging` would report 1 (the user that just switched). This behavior allows you to accurately track your release adoption, even in the event of using a runtime-based deployment redirection solution.*
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
- ### Example Apps / Starters
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
- Additionally, if you're looking to get started with React Native + CodePush, and are looking for an awesome starter kit, you should check out the following:
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
- * [Pepperoni](http://getpepperoni.com/)
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. For RN < v0.40 use: `#import "RCTLog.h"`
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 | Possible Solution |
420
- |-----------------|-------------------|
421
- | Compilation Error | Double-check that your version of React Native is [compatible](#supported-react-native-platforms) with the CodePush version you are using. |
422
- | 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. |
423
- | 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. |
424
- | 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. |
425
- | 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. |
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 deployment keys for each platform in order to receive updates correctly |
427
- | 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.
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. |