@appzung/react-native-code-push 8.3.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/CodePush.podspec +3 -3
  3. package/LICENSE.md +1 -1
  4. package/README.md +159 -296
  5. package/android/app/.gradle/config.properties +2 -0
  6. package/android/app/build.gradle +2 -0
  7. package/android/app/local.properties +8 -0
  8. package/android/app/src/main/AndroidManifest.xml +1 -2
  9. package/android/app/src/main/java/com/microsoft/codepush/react/CodePush.java +27 -21
  10. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushBuilder.java +5 -5
  11. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushConstants.java +1 -1
  12. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushDialog.java +1 -1
  13. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushInstallMode.java +2 -2
  14. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushInvalidPublicKeyException.java +2 -2
  15. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushInvalidUpdateException.java +1 -1
  16. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushMalformedDataException.java +2 -2
  17. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushNativeModule.java +5 -5
  18. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushNotInitializedException.java +2 -2
  19. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushTelemetryManager.java +14 -14
  20. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushUnknownException.java +2 -2
  21. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushUpdateManager.java +1 -1
  22. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushUpdateState.java +2 -2
  23. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushUpdateUtils.java +16 -9
  24. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushUtils.java +1 -1
  25. package/android/app/src/main/java/com/microsoft/codepush/react/DownloadProgress.java +1 -1
  26. package/android/app/src/main/java/com/microsoft/codepush/react/DownloadProgressCallback.java +1 -1
  27. package/android/app/src/main/java/com/microsoft/codepush/react/FileUtils.java +1 -1
  28. package/android/app/src/main/java/com/microsoft/codepush/react/ReactInstanceHolder.java +1 -1
  29. package/android/app/src/main/java/com/microsoft/codepush/react/SettingsManager.java +1 -1
  30. package/android/app/src/main/java/com/microsoft/codepush/react/TLSSocketFactory.java +1 -1
  31. package/android/build.gradle +3 -0
  32. package/android/codepush.gradle +3 -3
  33. package/docs/advanced-usage.md +56 -0
  34. package/docs/api-android.md +12 -75
  35. package/docs/api-ios.md +5 -17
  36. package/docs/api-js.md +18 -55
  37. package/docs/setup-android.md +15 -397
  38. package/docs/setup-ios.md +24 -198
  39. package/docs/setup-windows.md +7 -74
  40. package/ios/CodePush/CodePush.h +4 -4
  41. package/ios/CodePush/CodePush.m +10 -9
  42. package/ios/CodePush/CodePushConfig.m +14 -11
  43. package/ios/CodePush/CodePushPackage.m +60 -60
  44. package/ios/CodePush/CodePushTelemetryManager.m +13 -13
  45. package/ios/CodePush.xcodeproj/project.pbxproj +24 -470
  46. package/ios/PrivacyInfo.xcprivacy +31 -0
  47. package/package.json +27 -24
  48. package/react-native.config.js +1 -1
  49. package/scripts/generateBundledResourcesHash.js +1 -1
  50. package/scripts/getFilesInFolder.js +1 -1
  51. package/scripts/recordFilesBeforeBundleCommand.js +1 -1
  52. package/typings/react-native-code-push.d.ts +22 -22
  53. package/windows/CodePush/CodePushConfig.cpp +3 -3
  54. package/windows/CodePush/CodePushConfig.h +3 -3
  55. package/windows/CodePush/CodePushNativeModule.cpp +27 -27
  56. package/windows/CodePush/CodePushNativeModule.h +4 -4
  57. package/windows/CodePush/CodePushTelemetryManager.cpp +12 -12
  58. package/windows/CodePush/CodePushTelemetryManager.h +1 -1
  59. package/.azurepipelines/build-rn-code-push-1es.yml +0 -104
  60. package/.azurepipelines/test-rn-code-push.yml +0 -94
  61. package/.config/CredScanSuppressions.json +0 -14
  62. package/SECURITY.md +0 -41
  63. package/docs/multi-deployment-testing-android.md +0 -148
  64. package/docs/multi-deployment-testing-ios.md +0 -59
  65. package/ios/CodePush/Base64/Base64/MF_Base64Additions.h +0 -34
  66. package/ios/CodePush/Base64/Base64/MF_Base64Additions.m +0 -252
  67. package/ios/CodePush/Base64/README.md +0 -47
  68. package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithm.h +0 -69
  69. package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmFactory.h +0 -16
  70. package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmFactory.m +0 -51
  71. package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmNone.h +0 -15
  72. package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmNone.m +0 -55
  73. package/ios/CodePush/JWT/Core/Algorithms/ESFamily/JWTAlgorithmESBase.h +0 -24
  74. package/ios/CodePush/JWT/Core/Algorithms/ESFamily/JWTAlgorithmESBase.m +0 -41
  75. package/ios/CodePush/JWT/Core/Algorithms/HSFamily/JWTAlgorithmHSBase.h +0 -28
  76. package/ios/CodePush/JWT/Core/Algorithms/HSFamily/JWTAlgorithmHSBase.m +0 -205
  77. package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolder.h +0 -103
  78. package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolder.m +0 -322
  79. package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolderChain.h +0 -37
  80. package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolderChain.m +0 -145
  81. package/ios/CodePush/JWT/Core/Algorithms/RSFamily/JWTAlgorithmRSBase.h +0 -35
  82. package/ios/CodePush/JWT/Core/Algorithms/RSFamily/JWTAlgorithmRSBase.m +0 -551
  83. package/ios/CodePush/JWT/Core/Algorithms/RSFamily/JWTRSAlgorithm.h +0 -23
  84. package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKey.h +0 -43
  85. package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKey.m +0 -230
  86. package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKeyExtractor.h +0 -31
  87. package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKeyExtractor.m +0 -113
  88. package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoSecurity.h +0 -38
  89. package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoSecurity.m +0 -500
  90. package/ios/CodePush/JWT/Core/ClaimSet/JWTClaim.h +0 -18
  91. package/ios/CodePush/JWT/Core/ClaimSet/JWTClaim.m +0 -214
  92. package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSet.h +0 -23
  93. package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSet.m +0 -29
  94. package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetSerializer.h +0 -19
  95. package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetSerializer.m +0 -68
  96. package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetVerifier.h +0 -18
  97. package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetVerifier.m +0 -72
  98. package/ios/CodePush/JWT/Core/Coding/JWTCoding+ResultTypes.h +0 -67
  99. package/ios/CodePush/JWT/Core/Coding/JWTCoding+ResultTypes.m +0 -111
  100. package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionOne.h +0 -119
  101. package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionOne.m +0 -307
  102. package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionThree.h +0 -94
  103. package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionThree.m +0 -619
  104. package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionTwo.h +0 -164
  105. package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionTwo.m +0 -514
  106. package/ios/CodePush/JWT/Core/Coding/JWTCoding.h +0 -24
  107. package/ios/CodePush/JWT/Core/Coding/JWTCoding.m +0 -11
  108. package/ios/CodePush/JWT/Core/FrameworkSupplement/JWT.h +0 -52
  109. package/ios/CodePush/JWT/Core/FrameworkSupplement/Map.modulemap +0 -5
  110. package/ios/CodePush/JWT/Core/Supplement/JWTBase64Coder.h +0 -28
  111. package/ios/CodePush/JWT/Core/Supplement/JWTBase64Coder.m +0 -70
  112. package/ios/CodePush/JWT/Core/Supplement/JWTDeprecations.h +0 -22
  113. package/ios/CodePush/JWT/Core/Supplement/JWTErrorDescription.h +0 -34
  114. package/ios/CodePush/JWT/Core/Supplement/JWTErrorDescription.m +0 -73
  115. package/ios/CodePush/JWT/LICENSE +0 -19
  116. package/ios/CodePush/JWT/README.md +0 -489
  117. package/ios/CodePush/SSZipArchive/Common.h +0 -81
  118. package/ios/CodePush/SSZipArchive/README.md +0 -1
  119. package/ios/CodePush/SSZipArchive/SSZipArchive.h +0 -76
  120. package/ios/CodePush/SSZipArchive/SSZipArchive.m +0 -691
  121. package/ios/CodePush/SSZipArchive/aes/aes.h +0 -198
  122. package/ios/CodePush/SSZipArchive/aes/aes_via_ace.h +0 -541
  123. package/ios/CodePush/SSZipArchive/aes/aescrypt.c +0 -294
  124. package/ios/CodePush/SSZipArchive/aes/aeskey.c +0 -548
  125. package/ios/CodePush/SSZipArchive/aes/aesopt.h +0 -739
  126. package/ios/CodePush/SSZipArchive/aes/aestab.c +0 -391
  127. package/ios/CodePush/SSZipArchive/aes/aestab.h +0 -173
  128. package/ios/CodePush/SSZipArchive/aes/brg_endian.h +0 -126
  129. package/ios/CodePush/SSZipArchive/aes/brg_types.h +0 -219
  130. package/ios/CodePush/SSZipArchive/aes/entropy.c +0 -54
  131. package/ios/CodePush/SSZipArchive/aes/entropy.h +0 -16
  132. package/ios/CodePush/SSZipArchive/aes/fileenc.c +0 -144
  133. package/ios/CodePush/SSZipArchive/aes/fileenc.h +0 -121
  134. package/ios/CodePush/SSZipArchive/aes/hmac.c +0 -145
  135. package/ios/CodePush/SSZipArchive/aes/hmac.h +0 -103
  136. package/ios/CodePush/SSZipArchive/aes/prng.c +0 -155
  137. package/ios/CodePush/SSZipArchive/aes/prng.h +0 -82
  138. package/ios/CodePush/SSZipArchive/aes/pwd2key.c +0 -103
  139. package/ios/CodePush/SSZipArchive/aes/pwd2key.h +0 -57
  140. package/ios/CodePush/SSZipArchive/aes/sha1.c +0 -258
  141. package/ios/CodePush/SSZipArchive/aes/sha1.h +0 -73
  142. package/ios/CodePush/SSZipArchive/minizip/crypt.h +0 -130
  143. package/ios/CodePush/SSZipArchive/minizip/ioapi.c +0 -369
  144. package/ios/CodePush/SSZipArchive/minizip/ioapi.h +0 -175
  145. package/ios/CodePush/SSZipArchive/minizip/mztools.c +0 -284
  146. package/ios/CodePush/SSZipArchive/minizip/mztools.h +0 -31
  147. package/ios/CodePush/SSZipArchive/minizip/unzip.c +0 -1839
  148. package/ios/CodePush/SSZipArchive/minizip/unzip.h +0 -248
  149. package/ios/CodePush/SSZipArchive/minizip/zip.c +0 -1910
  150. package/ios/CodePush/SSZipArchive/minizip/zip.h +0 -202
  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,224 +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
-
7
- *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.*
8
-
9
- ![Switching tags](https://user-images.githubusercontent.com/42337914/57237511-0835de80-7030-11e9-88fa-64eb200478d0.png)
10
-
11
- 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).
12
-
13
- <!-- React Native Catalog -->
1
+ # React Native Module for AppZung CodePush
14
2
 
3
+ * [AppZung](#appzung)
15
4
  * [How does it work?](#how-does-it-work)
16
- * [Supported React Native Platforms](#supported-react-native-platforms)
17
- * [Supported Components](#supported-components)
18
- * [Getting Started](#getting-started)
19
- * [iOS Setup](docs/setup-ios.md)
20
- * [Android Setup](docs/setup-android.md)
21
- * [Windows Setup](docs/setup-windows.md)
22
- * [Plugin Usage](#plugin-usage)
23
- * [Store Guideline Compliance](#store-guideline-compliance)
24
- * [Releasing Updates](#releasing-updates)
25
- * [Multi-Deployment Testing](#multi-deployment-testing)
26
- * [Android](docs/multi-deployment-testing-android.md)
27
- * [iOS](docs/multi-deployment-testing-ios.md)
28
- * [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)
29
15
  * [API Reference](#api-reference)
30
- * [JavaScript API](docs/api-js.md)
31
- * [Objective-C API Reference (iOS)](docs/api-ios.md)
32
- * [Java API Reference (Android)](docs/api-android.md)
33
16
  * [Debugging / Troubleshooting](#debugging--troubleshooting)
34
- * [Example Apps / Starters](#example-apps--starters)
35
- * [Continuous Integration / Delivery](#continuous-integration--delivery)
36
- * [TypeScript Consumption](#typescript-consumption)
37
-
38
- <!-- React Native Catalog -->
39
-
40
- ## How does it work?
41
-
42
- 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.
43
-
44
- 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!
45
17
 
46
- 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
47
19
 
48
- *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).
49
22
 
50
- ## Supported React Native platforms
23
+ We will offer feature-parity with the original CodePush and introduce advanced capabilities in:
51
24
 
52
- - iOS (7+)
53
- - Android (4.1+) on TLS 1.2 compatible devices
54
- - Windows (UWP)
25
+ - Hosting
26
+ - Delivery
27
+ - Analytics
28
+ - Security
29
+ - Privacy
55
30
 
56
- 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.
57
32
 
58
- | React Native version(s) | Supporting CodePush version(s) |
59
- |-------------------------|-------------------------------------------------------|
60
- | <0.14 | **Unsupported** |
61
- | v0.14 | v1.3 *(introduced Android support)* |
62
- | v0.15-v0.18 | v1.4-v1.6 *(introduced iOS asset support)* |
63
- | v0.19-v0.28 | v1.7-v1.17 *(introduced Android asset support)* |
64
- | v0.29-v0.30 | v1.13-v1.17 *(RN refactored native hosting code)* |
65
- | v0.31-v0.33 | v1.14.6-v1.17 *(RN refactored native hosting code)* |
66
- | v0.34-v0.35 | v1.15-v1.17 *(RN refactored native hosting code)* |
67
- | v0.36-v0.39 | v1.16-v1.17 *(RN refactored resume handler)* |
68
- | v0.40-v0.42 | v1.17 *(RN refactored iOS header files)* |
69
- | v0.43-v0.44 | v2.0+ *(RN refactored uimanager dependencies)* |
70
- | v0.45 | v3.0+ *(RN refactored instance manager code)* |
71
- | v0.46 | v4.0+ *(RN refactored js bundle loader code)* |
72
- | v0.46-v0.53 | v5.1+ *(RN removed unused registration of JS modules)*|
73
- | v0.54-v0.55 | v5.3+ *(Android Gradle Plugin 3.x integration)* |
74
- | v0.56-v0.58 | v5.4+ *(RN upgraded versions for Android tools)* |
75
- | v0.59 | v5.6+ *(RN refactored js bundle loader code)* |
76
- | v0.60-v0.61 | v6.0+ *(RN migrated to Autolinking)* |
77
- | v0.62-v0.64 | v6.2+ *(RN removed LiveReload)* |
78
- | v0.65-v0.70 | v7.0+ *(RN updated iPhone-target-version)* |
79
- | v0.71 | v8.0+ *(RN moved to react-native-gradle-plugin)* |
80
-
81
- *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.
82
34
 
83
- 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.
84
36
 
85
- ### Supported Components
37
+ ## How does it work?
86
38
 
87
- 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.
88
40
 
89
- | Component | Prop(s) |
90
- |-------------------------------------------------|------------------------------------------|
91
- | `Image` | `source` |
92
- | `MapView.Marker` <br />*(Requires [react-native-maps](https://github.com/lelandrichardson/react-native-maps) `>=O.3.2`)* | `image` |
93
- | `ProgressViewIOS` | `progressImage`, `trackImage` |
94
- | `TabBarIOS.Item` | `icon`, `selectedIcon` |
95
- | `ToolbarAndroid` <br />*(React Native 0.21.0+)* | `actions[].icon`, `logo`, `overflowIcon` |
96
- | `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!
97
42
 
98
- 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!
99
44
 
100
- | Component | Prop(s) |
101
- |-------------|----------------------------------------------------------------------|
102
- | `SliderIOS` | `maximumTrackImage`, `minimumTrackImage`, `thumbImage`, `trackImage` |
103
- | `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).*
104
46
 
105
- 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
106
48
 
107
- *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).
108
50
 
109
- ```javascript
110
- <Video source={require("./foo.mp4")} />
51
+ ```shell
52
+ npm install --save @appzung/react-native-code-push
111
53
  ```
112
54
 
113
- ## Getting Started
55
+ *NOTE: For Expo apps a plugin will be made available soon. In the meantime, you may eject.*
114
56
 
115
- 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:
116
58
 
117
- ```shell
118
- npm install --save react-native-code-push
119
- ```
59
+ * [iOS Setup](docs/setup-ios.md)
60
+ * [Android Setup](docs/setup-android.md)
61
+ * [Windows Setup](docs/setup-windows.md)
120
62
 
121
- 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
122
64
 
123
- 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.
124
66
 
125
- *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).
126
68
 
127
- Then continue with installing the native module
128
- * [iOS Setup](docs/setup-ios.md)
129
- * [Android Setup](docs/setup-android.md)
130
- * [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.
131
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.
132
72
 
133
- ## Plugin Usage
73
+ We renamed "deployments" to "release channels" for better clarity between actual release deployments and their release channels.
134
74
 
135
- 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
136
76
 
137
- 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)
138
80
 
139
- 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
140
82
 
141
- 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.
142
84
 
143
- * **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:
144
86
 
145
- * 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).
146
91
 
147
- ```javascript
148
- import codePush from "react-native-code-push";
92
+ ### Migration steps to @appzung/react-native-code-push v10+
149
93
 
150
- class MyApp extends Component {
151
- }
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.
152
95
 
153
- MyApp = codePush(MyApp);
154
- ```
96
+ #### Switch to @appzung/react-native-code-push npm package
155
97
 
156
- * 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)
157
100
 
158
- ```javascript
159
- import codePush from "react-native-code-push";
101
+ #### Change your JS code
160
102
 
161
- let MyApp: () => React$Node = () => {
162
- }
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)
163
106
 
164
- MyApp = codePush(MyApp);
165
- ```
107
+ #### Change your iOS setup
166
108
 
167
- * **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`
168
112
 
169
- *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
170
114
 
171
- * 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
172
120
 
173
- ```javascript
174
- import codePush from "react-native-code-push";
121
+ ## Compatibility table
175
122
 
176
- @codePush
177
- class MyApp extends Component {
178
- }
179
- ```
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:
180
124
 
181
- * 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+ |
182
134
 
183
- ```javascript
184
- 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.
185
136
 
186
- const MyApp: () => React$Node = () => {
187
- }
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.
188
138
 
189
- export default codePush(MyApp);
190
- ```
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.
191
140
 
192
- 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
193
142
 
194
- 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:
195
144
 
196
- * 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?
197
147
 
198
- ```javascript
199
- let codePushOptions = { checkFrequency: codePush.CheckFrequency.ON_APP_RESUME };
148
+ The simplest way to do this is to "CodePush-ify" your app's root component:
200
149
 
201
- class MyApp extends Component {
202
- }
150
+ ```javascript
151
+ import codePush from "@appzung/react-native-code-push";
203
152
 
204
- MyApp = codePush(codePushOptions)(MyApp);
205
- ```
153
+ const MyApp = () => {
154
+ }
206
155
 
207
- * For functional component
156
+ export default codePush(MyApp);
157
+ ```
208
158
 
209
- ```javascript
210
- 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.
211
160
 
212
- let MyApp: () => React$Node = () => {
213
- }
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.
214
162
 
215
- MyApp = codePush(codePushOptions)(MyApp);
216
- ```
163
+ ```javascript
164
+ codePush({ checkFrequency: codePush.CheckFrequency.ON_APP_RESUME })(MyApp);
165
+ ```
217
166
 
218
- 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`:
219
168
 
220
169
  ```javascript
221
- let codePushOptions = { checkFrequency: codePush.CheckFrequency.MANUAL };
170
+ import codePush from "@appzung/react-native-code-push";
222
171
 
223
172
  class MyApp extends Component {
224
173
  onButtonPress() {
@@ -239,137 +188,88 @@ class MyApp extends Component {
239
188
  }
240
189
  }
241
190
 
242
- MyApp = codePush(codePushOptions)(MyApp);
191
+ export default codePush({ checkFrequency: codePush.CheckFrequency.MANUAL })(MyApp);
243
192
  ```
244
193
 
245
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.
246
195
 
247
- *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.*
248
-
249
- ### Store Guideline Compliance
250
-
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.
252
-
253
- #### Google play
196
+ ## Releasing updates
254
197
 
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).
257
-
258
- That fully allow CodePush as it updates just JS bundles and can't update native code part.
259
-
260
- #### App Store
261
-
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:
263
-
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.
265
-
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.
267
-
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:
269
-
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.
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.
271
199
 
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.
273
-
274
- ## Releasing Updates
200
+ ### Locally
275
201
 
276
- 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.
202
+ *NOTE: Before you can start releasing updates, please log into AppZung by running the `appzung auth login` command.*
277
203
 
278
- *NOTE: Before you can start releasing updates, please log into App Center by running the `appcenter login` command.*
279
-
280
- 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:
281
205
 
282
206
  ```shell
283
- appcenter codepush release-react -a <ownerName>/<appName>
284
-
285
- appcenter codepush release-react -a <ownerName>/MyApp-iOS
286
- appcenter codepush release-react -a <ownerName>/MyApp-Android
207
+ appzung releases deploy-react-native
287
208
  ```
288
209
 
289
- 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:
290
211
 
291
212
  ```shell
292
- # Release a mandatory update with a changelog
293
- appcenter codepush release-react -a <ownerName>/MyApp-iOS -m --description "Modified the header color"
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
294
215
 
295
- # Release an update for an app that uses a non-standard entry file name, and also capture
296
- # the sourcemap file generated by react-native bundle
297
- appcenter codepush release-react -a <ownerName>/MyApp-iOS --entry-file MyApp.js --sourcemap-output ../maps/MyApp.map
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
298
218
 
299
- # Release a dev Android build to just 1/4 of your end users
300
- appcenter codepush release-react -a <ownerName>/MyApp-Android --rollout 25 --development true
301
-
302
- # Release an update that targets users running any 1.1.* binary, as opposed to
303
- # limiting the update to exact version name in the build.gradle file
304
- 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"
305
221
 
222
+ # See other flags
223
+ appzung releases deploy-react-native --help
306
224
  ```
307
225
 
308
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.
309
227
 
310
- 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.
311
229
 
312
- 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.
313
231
 
314
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.*
315
233
 
316
- ### Multi-Deployment Testing
317
-
318
- 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.
319
-
320
- *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.*
321
-
322
- Taking advantage of the `Staging` and `Production` deployments allows you to achieve a workflow like the following (feel free to customize!):
234
+ ### On CI
323
235
 
324
- 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`.
325
237
 
326
- 2. Run your staging/beta build of your app, sync the update from the server, and verify it works as expected
327
-
328
- 3. Promote the tested release from `Staging` to `Production` using the `appcenter codepush promote` command
329
-
330
- 4. Run your production/release build of your app, sync the update from the server and verify it works as expected
331
-
332
- *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`.*
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
+ ```
333
242
 
334
- 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:
243
+ We will publish a guide with best practices and workflows examples for GitHub Actions and Bitrise.
335
244
 
336
- * [Android](docs/multi-deployment-testing-android.md)
337
- * [iOS](docs/multi-deployment-testing-ios.md)
245
+ ### Advanced usage
338
246
 
247
+ See the corresponding documentation file about [Advanced usage](./docs/advanced-usage.md).
339
248
 
340
- ### Dynamic Deployment Assignment
249
+ ## Store guidelines compliance
341
250
 
342
- 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.
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.
343
252
 
344
- 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.
253
+ ### Google play
345
254
 
346
- ```javascript
347
- // Imagine that "userProfile" is a prop that this component received
348
- // which includes the deployment key that the current user should use.
349
- codePush.sync({ deploymentKey: userProfile.CODEPUSH_KEY });
350
- ```
351
-
352
- 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).
353
257
 
354
- 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.
355
259
 
356
- 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
357
261
 
358
- *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:
359
263
 
360
- 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.
361
265
 
362
- ```javascript
363
- // #1) Create your new deployment to hold releases of a specific app variant
364
- 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.
365
267
 
366
- // #2) Target any new releases at that custom deployment
367
- appcenter codepush release-react -a <ownerName>/<appName> -d test-variant-one
368
- ```
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:
369
269
 
370
- *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.
371
271
 
372
- ---
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.
373
273
 
374
274
  ## API Reference
375
275
 
@@ -377,34 +277,15 @@ appcenter codepush release-react -a <ownerName>/<appName> -d test-variant-one
377
277
  * [Objective-C API Reference (iOS)](docs/api-ios.md)
378
278
  * [Java API Reference (Android)](docs/api-android.md)
379
279
 
380
- ### Example Apps / Starters
381
-
382
- 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:
383
-
384
- * [F8 App](https://github.com/fbsamples/f8app) - The official conference app for [F8 2016](https://www.fbf8.com/).
385
- * [Feline for Product Hunt](https://github.com/arjunkomath/Feline-for-Product-Hunt) - An Android client for Product Hunt.
386
- * [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.
387
- * [Math Facts](https://github.com/Khan/math-facts) - An app by Khan Academy to help memorize math facts more easily.
280
+ ## Debugging / Troubleshooting
388
281
 
389
- 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.
390
283
 
391
- * [Pepperoni](http://getpepperoni.com/)
392
-
393
- *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!*
394
-
395
- ### Debugging / Troubleshooting
396
-
397
- 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.
398
-
399
- 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.
400
-
401
- <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">
402
-
403
- 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]`.
404
285
 
405
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:
406
287
 
407
- 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
408
289
 
409
290
  2. Add the following statement to the top of your `application:didFinishLaunchingWithOptions` method:
410
291
 
@@ -414,30 +295,12 @@ Note that by default, React Native logs are disabled on iOS in release builds, s
414
295
 
415
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:
416
297
 
417
- | Issue / Symptom | Possible Solution |
418
- |-----------------|-------------------|
419
- | Compilation Error | Double-check that your version of React Native is [compatible](#supported-react-native-platforms) with the CodePush version you are using. |
420
- | 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. |
421
- | 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. |
422
- | 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. |
423
- | 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. |
424
- | 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 |
425
- | 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.
426
- | 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.
427
-
428
- ### Continuous Integration / Delivery
429
-
430
- 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:
431
-
432
- * [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.*
433
- * [Travis CI](https://github.com/mondora/code-push-travis-cli)
434
-
435
- 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/).
436
-
437
- ### TypeScript Consumption
438
-
439
- 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'`.
440
-
441
- ---
442
-
443
- 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. |