@appzung/react-native-code-push 11.0.0-rc5 → 11.0.0-rc6

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 (197) hide show
  1. package/android/app/src/main/java/com/appzung/codepush/react/CodePushConstants.java +2 -0
  2. package/android/app/src/main/java/com/appzung/codepush/react/CodePushNativeModule.java +62 -0
  3. package/ios/CodePush/CodePush.h +2 -0
  4. package/ios/CodePush/CodePush.m +28 -0
  5. package/ios/CodePush/CodePushConfig.m +50 -0
  6. package/lib/commonjs/allowRestart.js +4 -2
  7. package/lib/commonjs/allowRestart.js.map +1 -1
  8. package/lib/commonjs/checkForUpdates.js +1 -1
  9. package/lib/commonjs/checkForUpdates.js.map +1 -1
  10. package/lib/commonjs/clearUpdates.js +4 -2
  11. package/lib/commonjs/clearUpdates.js.map +1 -1
  12. package/lib/commonjs/dataTransmission.js +28 -0
  13. package/lib/commonjs/dataTransmission.js.map +1 -0
  14. package/lib/commonjs/disallowRestart.js +4 -2
  15. package/lib/commonjs/disallowRestart.js.map +1 -1
  16. package/lib/commonjs/enums/LogLevel.enum.js +3 -0
  17. package/lib/commonjs/enums/LogLevel.enum.js.map +1 -1
  18. package/lib/commonjs/index.js +36 -0
  19. package/lib/commonjs/index.js.map +1 -1
  20. package/lib/commonjs/internals/CodePushApiSdk.js +23 -1
  21. package/lib/commonjs/internals/CodePushApiSdk.js.map +1 -1
  22. package/lib/commonjs/internals/CodePushApiSdk.types.js.map +1 -1
  23. package/lib/commonjs/internals/logger.js +51 -0
  24. package/lib/commonjs/internals/logger.js.map +1 -0
  25. package/lib/commonjs/internals/utils/log.js +4 -2
  26. package/lib/commonjs/internals/utils/log.js.map +1 -1
  27. package/lib/commonjs/internals/version.js +1 -1
  28. package/lib/commonjs/logger.js +19 -0
  29. package/lib/commonjs/logger.js.map +1 -0
  30. package/lib/commonjs/notifyAppReady.js +4 -2
  31. package/lib/commonjs/notifyAppReady.js.map +1 -1
  32. package/lib/commonjs/restartApp.js +2 -2
  33. package/lib/commonjs/restartApp.js.map +1 -1
  34. package/lib/commonjs/sync.js +5 -3
  35. package/lib/commonjs/sync.js.map +1 -1
  36. package/lib/commonjs/telemetry.js +28 -0
  37. package/lib/commonjs/telemetry.js.map +1 -0
  38. package/lib/module/allowRestart.js +3 -1
  39. package/lib/module/allowRestart.js.map +1 -1
  40. package/lib/module/checkForUpdates.js +1 -1
  41. package/lib/module/checkForUpdates.js.map +1 -1
  42. package/lib/module/clearUpdates.js +3 -1
  43. package/lib/module/clearUpdates.js.map +1 -1
  44. package/lib/module/dataTransmission.js +24 -0
  45. package/lib/module/dataTransmission.js.map +1 -0
  46. package/lib/module/disallowRestart.js +3 -1
  47. package/lib/module/disallowRestart.js.map +1 -1
  48. package/lib/module/enums/LogLevel.enum.js +3 -0
  49. package/lib/module/enums/LogLevel.enum.js.map +1 -1
  50. package/lib/module/index.js +3 -0
  51. package/lib/module/index.js.map +1 -1
  52. package/lib/module/internals/CodePushApiSdk.js +23 -1
  53. package/lib/module/internals/CodePushApiSdk.js.map +1 -1
  54. package/lib/module/internals/CodePushApiSdk.types.js.map +1 -1
  55. package/lib/module/internals/logger.js +44 -0
  56. package/lib/module/internals/logger.js.map +1 -0
  57. package/lib/module/internals/utils/log.js +4 -2
  58. package/lib/module/internals/utils/log.js.map +1 -1
  59. package/lib/module/internals/version.js +1 -1
  60. package/lib/module/logger.js +4 -0
  61. package/lib/module/logger.js.map +1 -0
  62. package/lib/module/notifyAppReady.js +4 -2
  63. package/lib/module/notifyAppReady.js.map +1 -1
  64. package/lib/module/restartApp.js +2 -2
  65. package/lib/module/restartApp.js.map +1 -1
  66. package/lib/module/sync.js +5 -3
  67. package/lib/module/sync.js.map +1 -1
  68. package/lib/module/telemetry.js +24 -0
  69. package/lib/module/telemetry.js.map +1 -0
  70. package/lib/typescript/commonjs/src/allowRestart.d.ts +1 -1
  71. package/lib/typescript/commonjs/src/allowRestart.d.ts.map +1 -1
  72. package/lib/typescript/commonjs/src/clearUpdates.d.ts +1 -1
  73. package/lib/typescript/commonjs/src/clearUpdates.d.ts.map +1 -1
  74. package/lib/typescript/commonjs/src/dataTransmission.d.ts +13 -0
  75. package/lib/typescript/commonjs/src/dataTransmission.d.ts.map +1 -0
  76. package/lib/typescript/commonjs/src/disallowRestart.d.ts +1 -1
  77. package/lib/typescript/commonjs/src/disallowRestart.d.ts.map +1 -1
  78. package/lib/typescript/commonjs/src/enums/LogLevel.enum.d.ts +3 -0
  79. package/lib/typescript/commonjs/src/enums/LogLevel.enum.d.ts.map +1 -1
  80. package/lib/typescript/commonjs/src/index.d.ts +3 -0
  81. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  82. package/lib/typescript/commonjs/src/internals/CodePushApiSdk.d.ts +3 -1
  83. package/lib/typescript/commonjs/src/internals/CodePushApiSdk.d.ts.map +1 -1
  84. package/lib/typescript/commonjs/src/internals/CodePushApiSdk.types.d.ts +2 -0
  85. package/lib/typescript/commonjs/src/internals/CodePushApiSdk.types.d.ts.map +1 -1
  86. package/lib/typescript/commonjs/src/internals/RNAppZungCodePushModuleSpec.d.ts +4 -0
  87. package/lib/typescript/commonjs/src/internals/RNAppZungCodePushModuleSpec.d.ts.map +1 -1
  88. package/lib/typescript/commonjs/src/internals/logger.d.ts +33 -0
  89. package/lib/typescript/commonjs/src/internals/logger.d.ts.map +1 -0
  90. package/lib/typescript/commonjs/src/internals/utils/log.d.ts.map +1 -1
  91. package/lib/typescript/commonjs/src/internals/version.d.ts +1 -1
  92. package/lib/typescript/commonjs/src/logLevel.d.ts.map +1 -1
  93. package/lib/typescript/commonjs/src/logger.d.ts +3 -0
  94. package/lib/typescript/commonjs/src/logger.d.ts.map +1 -0
  95. package/lib/typescript/commonjs/src/notifyAppReady.d.ts +2 -0
  96. package/lib/typescript/commonjs/src/notifyAppReady.d.ts.map +1 -1
  97. package/lib/typescript/commonjs/src/restartApp.d.ts.map +1 -1
  98. package/lib/typescript/commonjs/src/sync.d.ts +2 -0
  99. package/lib/typescript/commonjs/src/sync.d.ts.map +1 -1
  100. package/lib/typescript/commonjs/src/telemetry.d.ts +13 -0
  101. package/lib/typescript/commonjs/src/telemetry.d.ts.map +1 -0
  102. package/lib/typescript/module/src/allowRestart.d.ts +1 -1
  103. package/lib/typescript/module/src/allowRestart.d.ts.map +1 -1
  104. package/lib/typescript/module/src/clearUpdates.d.ts +1 -1
  105. package/lib/typescript/module/src/clearUpdates.d.ts.map +1 -1
  106. package/lib/typescript/module/src/dataTransmission.d.ts +13 -0
  107. package/lib/typescript/module/src/dataTransmission.d.ts.map +1 -0
  108. package/lib/typescript/module/src/disallowRestart.d.ts +1 -1
  109. package/lib/typescript/module/src/disallowRestart.d.ts.map +1 -1
  110. package/lib/typescript/module/src/enums/LogLevel.enum.d.ts +3 -0
  111. package/lib/typescript/module/src/enums/LogLevel.enum.d.ts.map +1 -1
  112. package/lib/typescript/module/src/index.d.ts +3 -0
  113. package/lib/typescript/module/src/index.d.ts.map +1 -1
  114. package/lib/typescript/module/src/internals/CodePushApiSdk.d.ts +3 -1
  115. package/lib/typescript/module/src/internals/CodePushApiSdk.d.ts.map +1 -1
  116. package/lib/typescript/module/src/internals/CodePushApiSdk.types.d.ts +2 -0
  117. package/lib/typescript/module/src/internals/CodePushApiSdk.types.d.ts.map +1 -1
  118. package/lib/typescript/module/src/internals/RNAppZungCodePushModuleSpec.d.ts +4 -0
  119. package/lib/typescript/module/src/internals/RNAppZungCodePushModuleSpec.d.ts.map +1 -1
  120. package/lib/typescript/module/src/internals/logger.d.ts +33 -0
  121. package/lib/typescript/module/src/internals/logger.d.ts.map +1 -0
  122. package/lib/typescript/module/src/internals/utils/log.d.ts.map +1 -1
  123. package/lib/typescript/module/src/internals/version.d.ts +1 -1
  124. package/lib/typescript/module/src/logLevel.d.ts.map +1 -1
  125. package/lib/typescript/module/src/logger.d.ts +3 -0
  126. package/lib/typescript/module/src/logger.d.ts.map +1 -0
  127. package/lib/typescript/module/src/notifyAppReady.d.ts +2 -0
  128. package/lib/typescript/module/src/notifyAppReady.d.ts.map +1 -1
  129. package/lib/typescript/module/src/restartApp.d.ts.map +1 -1
  130. package/lib/typescript/module/src/sync.d.ts +2 -0
  131. package/lib/typescript/module/src/sync.d.ts.map +1 -1
  132. package/lib/typescript/module/src/telemetry.d.ts +13 -0
  133. package/lib/typescript/module/src/telemetry.d.ts.map +1 -0
  134. package/package.json +23 -14
  135. package/scripts/generateBundledResourcesHash.js +73 -68
  136. package/scripts/getFilesInFolder.js +12 -12
  137. package/scripts/recordFilesBeforeBundleCommand.js +19 -20
  138. package/src/allowRestart.ts +3 -1
  139. package/src/checkForUpdates.ts +1 -1
  140. package/src/clearUpdates.ts +3 -1
  141. package/src/dataTransmission.ts +21 -0
  142. package/src/disallowRestart.ts +3 -1
  143. package/src/enums/LogLevel.enum.ts +3 -0
  144. package/src/index.ts +3 -0
  145. package/src/internals/CodePushApiSdk.ts +27 -0
  146. package/src/internals/CodePushApiSdk.types.ts +2 -0
  147. package/src/internals/RNAppZungCodePushModuleSpec.ts +6 -0
  148. package/src/internals/logger.ts +46 -0
  149. package/src/internals/utils/log.ts +4 -2
  150. package/src/internals/version.ts +1 -1
  151. package/src/logger.ts +2 -0
  152. package/src/notifyAppReady.ts +4 -2
  153. package/src/restartApp.ts +2 -2
  154. package/src/sync.ts +5 -3
  155. package/src/telemetry.ts +21 -0
  156. package/docs/advanced-usage.md +0 -71
  157. package/docs/api-android.md +0 -22
  158. package/docs/api-ios.md +0 -19
  159. package/docs/api-js/README.md +0 -58
  160. package/docs/api-js/enumerations/CheckFrequency.md +0 -33
  161. package/docs/api-js/enumerations/DeploymentStatus.md +0 -25
  162. package/docs/api-js/enumerations/InstallMode.md +0 -50
  163. package/docs/api-js/enumerations/LogLevel.md +0 -31
  164. package/docs/api-js/enumerations/SyncStatus.md +0 -85
  165. package/docs/api-js/enumerations/UpdateState.md +0 -37
  166. package/docs/api-js/functions/allowRestart.md +0 -17
  167. package/docs/api-js/functions/checkForUpdate.md +0 -29
  168. package/docs/api-js/functions/clearUpdates.md +0 -19
  169. package/docs/api-js/functions/disallowRestart.md +0 -17
  170. package/docs/api-js/functions/getClientUniqueId.md +0 -15
  171. package/docs/api-js/functions/getLogLevel.md +0 -13
  172. package/docs/api-js/functions/getUpdateMetadata.md +0 -23
  173. package/docs/api-js/functions/notifyAppReady.md +0 -17
  174. package/docs/api-js/functions/resetClientUniqueId.md +0 -15
  175. package/docs/api-js/functions/restartApp.md +0 -25
  176. package/docs/api-js/functions/setLogLevel.md +0 -19
  177. package/docs/api-js/functions/sync.md +0 -43
  178. package/docs/api-js/functions/withCodePush.md +0 -65
  179. package/docs/api-js/interfaces/CodePushOptions.md +0 -118
  180. package/docs/api-js/interfaces/DownloadProgress.md +0 -23
  181. package/docs/api-js/interfaces/LocalPackage.md +0 -171
  182. package/docs/api-js/interfaces/Package.md +0 -98
  183. package/docs/api-js/interfaces/RemotePackage.md +0 -169
  184. package/docs/api-js/interfaces/RollbackRetryOptions.md +0 -28
  185. package/docs/api-js/interfaces/StatusReport.md +0 -47
  186. package/docs/api-js/interfaces/SyncOptions.md +0 -80
  187. package/docs/api-js/interfaces/UpdateDialog.md +0 -89
  188. package/docs/api-js/type-aliases/DownloadProgressCallback.md +0 -21
  189. package/docs/api-js/type-aliases/HandleBinaryVersionMismatchCallback.md +0 -23
  190. package/docs/api-js/type-aliases/SyncStatusChangedCallback.md +0 -23
  191. package/docs/api-js/variables/DEFAULT_UPDATE_DIALOG.md +0 -12
  192. package/docs/code-signing.md +0 -64
  193. package/docs/migrating-to-v10.md +0 -31
  194. package/docs/setup-android.md +0 -80
  195. package/docs/setup-ios.md +0 -108
  196. package/docs/setup-windows.md +0 -55
  197. package/typedoc.json +0 -9
@@ -1,12 +1,14 @@
1
1
  import type { LogLevel } from '../../enums/LogLevel.enum';
2
2
  import { getLogLevel } from '../../logLevel';
3
+ import { getLogger } from '../logger';
3
4
 
4
- /* Logs messages to console with the [CodePush] prefix */
5
+ /* Logs messages using the configured logger */
5
6
  export function log(level: LogLevel, message: string): void {
6
7
  const currentLogLevel = getLogLevel();
7
8
  if (level < currentLogLevel) {
8
9
  return;
9
10
  }
10
11
 
11
- console.log(`[CodePush] ${message}`);
12
+ const logger = getLogger();
13
+ logger(level, message);
12
14
  }
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- export const version = '11.0.0-rc5';
2
+ export const version = '11.0.0-rc6';
package/src/logger.ts ADDED
@@ -0,0 +1,2 @@
1
+ export { setLogger, resetLogger } from './internals/logger';
2
+ export type { LoggerFunction } from './internals/logger';
@@ -8,6 +8,8 @@ import { requestFetchAdapter } from './internals/utils/requestFetchAdapter';
8
8
  import type { StatusReport } from './types';
9
9
 
10
10
  /**
11
+ * @function
12
+ *
11
13
  * Notifies the CodePush runtime that an installed update is considered successful.
12
14
  *
13
15
  * If you are manually checking for and installing updates (i.e. not using the `sync` method to handle it all for you), then this method **MUST** be called; otherwise CodePush will treat the update as failed and rollback to the previous version when the app next restarts.
@@ -54,7 +56,7 @@ async function tryReportStatus(statusReport: StatusReport, retryOnAppResume?: Na
54
56
  throw new Error('Release channel is missing');
55
57
  }
56
58
 
57
- const sdk = new CodePushApiSdk(requestFetchAdapter, config);
59
+ const sdk = new CodePushApiSdk(requestFetchAdapter, log, config);
58
60
  await sdk.reportStatusDeploy(null, previousLabelOrAppVersion, previousReleaseChannelPublicId);
59
61
  } else {
60
62
  if (!statusReport.package) {
@@ -70,7 +72,7 @@ async function tryReportStatus(statusReport: StatusReport, retryOnAppResume?: Na
70
72
  }
71
73
 
72
74
  config.releaseChannelPublicId = statusReport.package.releaseChannelPublicId;
73
- const sdk = new CodePushApiSdk(requestFetchAdapter, config);
75
+ const sdk = new CodePushApiSdk(requestFetchAdapter, log, config);
74
76
  await sdk.reportStatusDeploy(
75
77
  {
76
78
  package: statusReport.package,
package/src/restartApp.ts CHANGED
@@ -7,6 +7,6 @@ import { NativeRNAppZungCodePushModule } from './internals/NativeRNAppZungCodePu
7
7
  *
8
8
  * @param onlyIfUpdateIsPending Indicates whether you want the restart to no-op if there isn't currently a pending update.
9
9
  */
10
- export async function restartApp(onlyIfUpdateIsPending = false) {
11
- NativeRNAppZungCodePushModule.restartApp(onlyIfUpdateIsPending);
10
+ export function restartApp(onlyIfUpdateIsPending = false) {
11
+ return NativeRNAppZungCodePushModule.restartApp(onlyIfUpdateIsPending);
12
12
  }
package/src/sync.ts CHANGED
@@ -81,10 +81,10 @@ async function syncInternal(
81
81
  log(LogLevel.INFO, 'User cancelled the update.');
82
82
  break;
83
83
  case SyncStatus.UPDATE_INSTALLED:
84
- if (resolvedInstallMode == InstallMode.ON_NEXT_RESTART) {
84
+ if (resolvedInstallMode === InstallMode.ON_NEXT_RESTART) {
85
85
  log(LogLevel.INFO, 'Update is installed and will be run on the next app restart.');
86
- } else if (resolvedInstallMode == InstallMode.ON_NEXT_RESUME) {
87
- if (!!syncOptions.minimumBackgroundDuration) {
86
+ } else if (resolvedInstallMode === InstallMode.ON_NEXT_RESUME) {
87
+ if (syncOptions.minimumBackgroundDuration) {
88
88
  log(
89
89
  LogLevel.INFO,
90
90
  `Update is installed and will be run after the app has been in the background for at least ${syncOptions.minimumBackgroundDuration} seconds.`,
@@ -210,6 +210,8 @@ async function syncInternal(
210
210
  }
211
211
 
212
212
  /**
213
+ * @function
214
+ *
213
215
  * Allows checking for an update, downloading it and installing it, all with a single call.
214
216
  *
215
217
  * Unless you need custom UI and/or behavior, we recommend most developers to use this method when integrating CodePush into their apps, if they are not using the `withCodePush` HOC.
@@ -0,0 +1,21 @@
1
+ import { NativeRNAppZungCodePushModule } from './internals/NativeRNAppZungCodePushModule';
2
+ import { reloadCachedConfiguration } from './internals/getConfiguration';
3
+
4
+ /**
5
+ * Controls telemetry reporting.
6
+ *
7
+ * @param enabled - When false, updates on this device will stop appearing as failed, pending or succeeded in analytics.
8
+ */
9
+ export async function setTelemetryEnabled(enabled: boolean): Promise<void> {
10
+ await NativeRNAppZungCodePushModule.setTelemetryEnabled(enabled);
11
+ await reloadCachedConfiguration();
12
+ }
13
+
14
+ /**
15
+ * Gets the current telemetry enabled status.
16
+ *
17
+ * When setTelemetryEnabled has never been enabled, returns the default value set in your configuration.
18
+ */
19
+ export function getTelemetryEnabled(): Promise<boolean> {
20
+ return NativeRNAppZungCodePushModule.getTelemetryEnabled();
21
+ }
@@ -1,71 +0,0 @@
1
- ## Advanced usage
2
-
3
- ### Multiple environments
4
-
5
- #### Staging / Production
6
-
7
- In a real-world scenario you would have `Staging` and `Production` apps that are different binaries, each using specific environment config (different package name, bundle identifier, API, feature flags etc). Create a release channel for each of these environments with `appzung release-channels create` and change the `CodePushReleaseChannelPublicId` on the native side with environment variables. You might want to use a module like [react-native-config](https://github.com/lugg/react-native-config) (or do it manually using build variants and configurations).
8
-
9
- ```groovy
10
- // android/app/build.gradle
11
- android {
12
- // ...
13
- defaultConfig {
14
- // ...
15
- resValue 'string', "CodePushReleaseChannelPublicId", project.env.get("CODEPUSH_RELEASE_CHANNEL_PUBLIC_ID_ANDROID")
16
- }
17
- }
18
- ```
19
-
20
- ```
21
- // ios/myapp/Info.plist
22
-
23
- <key>CodePushReleaseChannelPublicId</key>
24
- <string>$(CODEPUSH_RELEASE_CHANNEL_PUBLIC_ID_IOS)</string>
25
- ```
26
-
27
- #### QA / Production
28
-
29
- In the case where you have a `QA` environment that is completely iso-prod (meaning you can swap the JS bundle between those two apps), you may take advantage of the `promote` feature:
30
-
31
- 1. Release a CodePush update to your `QA` release channel using the `appzung releases deploy-react-native` command (or `appzung releases deploy` if you need more control)
32
- 2. Let QA test the build
33
- 3. Promote the tested release from `QA` to `Production` using the `appzung releases promote` command
34
-
35
- _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 `appzung releases promote -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 `appzung releases edit -r 100`._
36
-
37
- ### Dynamic release channel assignment
38
-
39
- The above section illustrated how you can leverage multiple CodePush release channels in order to effectively test your updates before broadly releasing them to your end users. However, since that workflow statically embeds the release channel assignment into the actual binary, a staging or production build will only ever sync updates from that release channel. 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 release channels at runtime.
40
-
41
- In order to achieve this kind of workflow, all you need to do is specify the release channel public ID you want the current user to synchronize 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 strings resources (Android) files. This allows you to produce a build for staging or production, that is also capable of being dynamically "redirected" as needed.
42
-
43
- ```javascript
44
- // Imagine that "userProfile" is a prop that this component received
45
- // which includes the release channel public ID that the current user should use.
46
- codePush.sync({ releaseChannelPublicId: userProfile.RELEASE_CHANNEL_PUBLIC_ID });
47
- ```
48
-
49
- With that change in place, now it's just a matter of choosing how your app determines the right release channel for the current user. In practice, there are typically two solutions for this:
50
-
51
- 1. Expose a user-visible mechanism for changing release channels 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.
52
- 2. Annotate the server-side profile of your users with an additional piece of metadata that indicates the release channel 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 release channel, which allows you to incrementally place certain users or groups in different release channels 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.
53
-
54
- _NOTE: If needed, you could also implement a hybrid solution that allowed your end-users to toggle between different release channels, while also allowing your server to override that decision. This way, you have a hierarchy of "release channel 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._
55
-
56
- Are you using dynamic release channel assignments? Contact us at hello@appzung.com so that we may provide better integration.
57
-
58
- ### Using a custom server URL
59
-
60
- This module lets you change the targeted CodePush server URL, this can be used by:
61
-
62
- - People who use a self-hosted basic CodePush server like the open source Microsoft's code-push-server. Note that you won't be able to use most features of AppZung with these self-hosted servers. We're committed to keep this module compatible with the basic CodePush features so that our users are not locked in.
63
- - Enterprise clients with a custom AppZung infrastructure
64
-
65
- #### iOS
66
-
67
- Add a `CodePushServerURL` in the `Info.plist` targeting your code-push server.
68
-
69
- #### Android
70
-
71
- Add a `CodePushServerUrl` in your strings resources targeting your code-push server.
@@ -1,22 +0,0 @@
1
- ## Java API reference (Android)
2
-
3
- You can customize CodePush by placing these values in string resources.
4
-
5
- - **Release channel Public ID** - The default release channel's **public ID** that will be used to check updates. For example:
6
-
7
- ```xml
8
- <string moduleConfig="true" name="CodePushReleaseChannelPublicId">sU0Eikse9JFCDLZmAT-_lUSwDWACrSGgTKCXyWqcE0</string>
9
- ```
10
-
11
- - **Public Key** - used for bundle verification in the Code Signing Feature. Please refer to [Code Signing](setup-android.md#code-signing-setup) section for more details about the Code Signing Feature.
12
- To set the public key, you should add the content of the public key to `strings.xml` with name `CodePushSigningPublicKey`. CodePush automatically gets this property and enables the Code Signing feature. For example:
13
-
14
- ```xml
15
- <string moduleConfig="true" name="CodePushSigningPublicKey">your-public-key</string>
16
- ```
17
-
18
- - **Server Url** - used for specifying CodePush Server Url (as an Enterprise customer we may setup a custom infra for your needs).
19
- The Default value: "https://codepush.appzung.com/" is overridden by adding your path to `strings.xml` with name `CodePushServerUrl`. CodePush automatically gets this property and will use this path to send requests. For example:
20
- ```xml
21
- <string moduleConfig="true" name="CodePushServerUrl">https://codepush.yourdomain.com</string>
22
- ```
package/docs/api-ios.md DELETED
@@ -1,19 +0,0 @@
1
- ## Objective-C API reference (iOS)
2
-
3
- The Objective-C API is made available by importing the `CodePush.h` header into your `AppDelegate.m` file, and consists of a single public class named `CodePush`.
4
-
5
- ### CodePush
6
-
7
- Contains static methods for retrieving the `NSURL` that represents the most recent JavaScript bundle file, and can be passed to the `RCTRootView`'s `initWithBundleURL` method when bootstrapping your app in the `AppDelegate.m` file.
8
-
9
- #### Methods
10
-
11
- - **(NSURL \*)bundleURL** - Returns the most recent JS bundle `NSURL` as described above. This method assumes that the name of the JS bundle contained within your app binary is `main.jsbundle`.
12
-
13
- - **(NSURL \*)bundleURLForResource:(NSString \*)resourceName** - Equivalent to the `bundleURL` method, but also allows customizing the name of the JS bundle that is looked for within the app binary. This is useful if you aren't naming this file `main` (which is the default convention). This method assumes that the JS bundle's extension is `*.jsbundle`.
14
-
15
- - **(NSURL \*)bundleURLForResource:(NSString \*)resourceName withExtension:(NSString \*)resourceExtension**: Equivalent to the `bundleURLForResource:` method, but also allows customizing the extension used by the JS bundle that is looked for within the app binary. This is useful if you aren't naming this file `*.jsbundle` (which is the default convention).
16
-
17
- - **(void)overrideAppVersion:(NSString \*)appVersionOverride** - Sets the version of the application's binary interface, which would otherwise default to the App Store version specified as the `CFBundleShortVersionString` in the `Info.plist`. This should be called a single time, before the bundle URL is loaded.
18
-
19
- - **(void)setReleaseChannelPublicId:(NSString \*)releaseChannelPublicId** - Sets the release channel public ID that the app should use when querying for updates. This is a dynamic alternative to setting the release channel in your `Info.plist` and/or specifying a release channel in JS when calling `checkForUpdate` or `sync`.
@@ -1,58 +0,0 @@
1
- **@appzung/react-native-code-push v11.0.0-rc5**
2
-
3
- ---
4
-
5
- # @appzung/react-native-code-push v11.0.0-rc5
6
-
7
- ## Enumerations
8
-
9
- - [CheckFrequency](enumerations/CheckFrequency.md)
10
- - [DeploymentStatus](enumerations/DeploymentStatus.md)
11
- - [InstallMode](enumerations/InstallMode.md)
12
- - [LogLevel](enumerations/LogLevel.md)
13
- - [SyncStatus](enumerations/SyncStatus.md)
14
- - [UpdateState](enumerations/UpdateState.md)
15
-
16
- ## Interfaces
17
-
18
- - [CodePushOptions](interfaces/CodePushOptions.md)
19
- - [DownloadProgress](interfaces/DownloadProgress.md)
20
- - [LocalPackage](interfaces/LocalPackage.md)
21
- - [Package](interfaces/Package.md)
22
- - [RemotePackage](interfaces/RemotePackage.md)
23
- - [RollbackRetryOptions](interfaces/RollbackRetryOptions.md)
24
- - [StatusReport](interfaces/StatusReport.md)
25
- - [SyncOptions](interfaces/SyncOptions.md)
26
- - [UpdateDialog](interfaces/UpdateDialog.md)
27
-
28
- ## Type Aliases
29
-
30
- - [DownloadProgressCallback](type-aliases/DownloadProgressCallback.md)
31
- - [HandleBinaryVersionMismatchCallback](type-aliases/HandleBinaryVersionMismatchCallback.md)
32
- - [SyncStatusChangedCallback](type-aliases/SyncStatusChangedCallback.md)
33
-
34
- ## Variables
35
-
36
- - [DEFAULT_UPDATE_DIALOG](variables/DEFAULT_UPDATE_DIALOG.md)
37
-
38
- ## Functions
39
-
40
- - [allowRestart](functions/allowRestart.md)
41
- - [checkForUpdate](functions/checkForUpdate.md)
42
- - [clearUpdates](functions/clearUpdates.md)
43
- - [disallowRestart](functions/disallowRestart.md)
44
- - [getClientUniqueId](functions/getClientUniqueId.md)
45
- - [getLogLevel](functions/getLogLevel.md)
46
- - [getUpdateMetadata](functions/getUpdateMetadata.md)
47
- - [notifyAppReady](functions/notifyAppReady.md)
48
- - [resetClientUniqueId](functions/resetClientUniqueId.md)
49
- - [restartApp](functions/restartApp.md)
50
- - [setLogLevel](functions/setLogLevel.md)
51
- - [sync](functions/sync.md)
52
- - [withCodePush](functions/withCodePush.md)
53
-
54
- ## References
55
-
56
- ### default
57
-
58
- Renames and re-exports [withCodePush](functions/withCodePush.md)
@@ -1,33 +0,0 @@
1
- [**@appzung/react-native-code-push v11.0.0-rc5**](../README.md)
2
-
3
- ---
4
-
5
- [@appzung/react-native-code-push](../README.md) / CheckFrequency
6
-
7
- # Enumeration: CheckFrequency
8
-
9
- Indicates when you would like to check for (and install) updates from the CodePush server.
10
-
11
- ## Enumeration Members
12
-
13
- ### MANUAL
14
-
15
- > **MANUAL**: `2`
16
-
17
- Don't automatically check for updates, but only do it when `sync()` is manually called in app code.
18
-
19
- ---
20
-
21
- ### ON_APP_RESUME
22
-
23
- > **ON_APP_RESUME**: `1`
24
-
25
- When the app re-enters the foreground after being "backgrounded" (user pressed the home button, app launches a separate payment process, etc.)
26
-
27
- ---
28
-
29
- ### ON_APP_START
30
-
31
- > **ON_APP_START**: `0`
32
-
33
- When the app is fully initialized (or more specifically, when the root component is mounted).
@@ -1,25 +0,0 @@
1
- [**@appzung/react-native-code-push v11.0.0-rc5**](../README.md)
2
-
3
- ---
4
-
5
- [@appzung/react-native-code-push](../README.md) / DeploymentStatus
6
-
7
- # Enumeration: DeploymentStatus
8
-
9
- Indicates the status of a deployment (after installing and restarting).
10
-
11
- ## Enumeration Members
12
-
13
- ### FAILED
14
-
15
- > **FAILED**: `"DeploymentFailed"`
16
-
17
- The deployment failed (and was rolled back).
18
-
19
- ---
20
-
21
- ### SUCCEEDED
22
-
23
- > **SUCCEEDED**: `"DeploymentSucceeded"`
24
-
25
- The deployment succeeded.
@@ -1,50 +0,0 @@
1
- [**@appzung/react-native-code-push v11.0.0-rc5**](../README.md)
2
-
3
- ---
4
-
5
- [@appzung/react-native-code-push](../README.md) / InstallMode
6
-
7
- # Enumeration: InstallMode
8
-
9
- Indicates when you would like an installed update to actually be applied.
10
-
11
- ## Enumeration Members
12
-
13
- ### IMMEDIATE
14
-
15
- > **IMMEDIATE**: `number`
16
-
17
- Indicates that you want to install the update and restart the app immediately.
18
-
19
- This value is appropriate for debugging scenarios as well as when displaying an update prompt to the user, since they would expect to see the changes immediately after accepting the installation. Additionally, this mode can be used to enforce mandatory updates, since it removes the potentially undesired latency between the update installation and the next time the end user restarts or resumes the app.
20
-
21
- ---
22
-
23
- ### ON_NEXT_RESTART
24
-
25
- > **ON_NEXT_RESTART**: `number`
26
-
27
- Indicates that you want to install the update, but not forcibly restart the app.
28
-
29
- When the app is "naturally" restarted (due the OS or end user killing it), the update will be seamlessly picked up. This value is appropriate when performing silent updates, since it would likely be disruptive to the end user if the app suddenly restarted out of nowhere, since they wouldn't have realized an update was even downloaded. This is the default mode used for both the `sync` and `LocalPackage.install` methods.
30
-
31
- ---
32
-
33
- ### ON_NEXT_RESUME
34
-
35
- > **ON_NEXT_RESUME**: `number`
36
-
37
- Indicates that you want to install the update, but don't want to restart the app until the next time the end user resumes it from the background.
38
-
39
- This way, you don't disrupt their current session,but you can get the update in front of them sooner than having to wait for the next natural restart.
40
- This value is appropriate for silent installs that can be applied on resume in a non-invasive way.
41
-
42
- ---
43
-
44
- ### ON_NEXT_SUSPEND
45
-
46
- > **ON_NEXT_SUSPEND**: `number`
47
-
48
- Indicates that you want to install the update when the app is in the background,
49
- but only after it has been in the background for "minimumBackgroundDuration" seconds (0 by default),
50
- so that user context isn't lost unless the app suspension is long enough to not matter.
@@ -1,31 +0,0 @@
1
- [**@appzung/react-native-code-push v11.0.0-rc5**](../README.md)
2
-
3
- ---
4
-
5
- [@appzung/react-native-code-push](../README.md) / LogLevel
6
-
7
- # Enumeration: LogLevel
8
-
9
- ## Enumeration Members
10
-
11
- ### DEBUG
12
-
13
- > **DEBUG**: `0`
14
-
15
- ---
16
-
17
- ### ERROR
18
-
19
- > **ERROR**: `3`
20
-
21
- ---
22
-
23
- ### INFO
24
-
25
- > **INFO**: `1`
26
-
27
- ---
28
-
29
- ### WARN
30
-
31
- > **WARN**: `2`
@@ -1,85 +0,0 @@
1
- [**@appzung/react-native-code-push v11.0.0-rc5**](../README.md)
2
-
3
- ---
4
-
5
- [@appzung/react-native-code-push](../README.md) / SyncStatus
6
-
7
- # Enumeration: SyncStatus
8
-
9
- Indicates the current status of a sync operation.
10
-
11
- ## Enumeration Members
12
-
13
- ### AWAITING_USER_ACTION
14
-
15
- > **AWAITING_USER_ACTION**: `6`
16
-
17
- An update is available, and a confirmation dialog was shown
18
- to the end user. (This is only applicable when the `updateDialog` is used)
19
-
20
- ---
21
-
22
- ### CHECKING_FOR_UPDATE
23
-
24
- > **CHECKING_FOR_UPDATE**: `5`
25
-
26
- The CodePush server is being queried for an update.
27
-
28
- ---
29
-
30
- ### DOWNLOADING_PACKAGE
31
-
32
- > **DOWNLOADING_PACKAGE**: `7`
33
-
34
- An available update is being downloaded from the CodePush server.
35
-
36
- ---
37
-
38
- ### INSTALLING_UPDATE
39
-
40
- > **INSTALLING_UPDATE**: `8`
41
-
42
- An available update was downloaded and is about to be installed.
43
-
44
- ---
45
-
46
- ### SYNC_IN_PROGRESS
47
-
48
- > **SYNC_IN_PROGRESS**: `4`
49
-
50
- There is an ongoing `sync` operation running which prevents the current call from being executed.
51
-
52
- ---
53
-
54
- ### UNKNOWN_ERROR
55
-
56
- > **UNKNOWN_ERROR**: `3`
57
-
58
- The `sync` operation encountered an unknown error.
59
-
60
- ---
61
-
62
- ### UP_TO_DATE
63
-
64
- > **UP_TO_DATE**: `0`
65
-
66
- The app is fully up-to-date with the configured release channel.
67
-
68
- ---
69
-
70
- ### UPDATE_IGNORED
71
-
72
- > **UPDATE_IGNORED**: `2`
73
-
74
- The app had an optional update which the end user chose to ignore.
75
- (This is only applicable when the `updateDialog` is used)
76
-
77
- ---
78
-
79
- ### UPDATE_INSTALLED
80
-
81
- > **UPDATE_INSTALLED**: `1`
82
-
83
- An available update has been installed and will be run either immediately after the
84
- `syncStatusChangedCallback` function returns or the next time the app resumes/restarts,
85
- depending on the `InstallMode` specified in `SyncOptions`
@@ -1,37 +0,0 @@
1
- [**@appzung/react-native-code-push v11.0.0-rc5**](../README.md)
2
-
3
- ---
4
-
5
- [@appzung/react-native-code-push](../README.md) / UpdateState
6
-
7
- # Enumeration: UpdateState
8
-
9
- Indicates the state that an update is currently in.
10
-
11
- ## Enumeration Members
12
-
13
- ### LATEST
14
-
15
- > **LATEST**: `number`
16
-
17
- Indicates than an update represents the latest available release, and can be either currently running or pending.
18
-
19
- ---
20
-
21
- ### PENDING
22
-
23
- > **PENDING**: `number`
24
-
25
- Indicates than an update has been installed, but the app hasn't been restarted yet in order to apply it.
26
-
27
- This can be useful for determining whether there is a pending update, which you may want to force a programmatic restart (via `restartApp`) in order to apply.
28
-
29
- ---
30
-
31
- ### RUNNING
32
-
33
- > **RUNNING**: `number`
34
-
35
- Indicates that an update represents the version of the app that is currently running.
36
-
37
- This can be useful for identifying attributes about the app, for scenarios such as displaying the release description in a "what's new?" dialog or reporting the latest version to an analytics and/or crash reporting service.
@@ -1,17 +0,0 @@
1
- [**@appzung/react-native-code-push v11.0.0-rc5**](../README.md)
2
-
3
- ---
4
-
5
- [@appzung/react-native-code-push](../README.md) / allowRestart
6
-
7
- # Function: allowRestart()
8
-
9
- > **allowRestart**(): `void`
10
-
11
- Allow CodePush to restart the app.
12
-
13
- This is an advanced API and is only necessary if your app explicitly disallowed restarts via the `disallowRestart` method.
14
-
15
- ## Returns
16
-
17
- `void`
@@ -1,29 +0,0 @@
1
- [**@appzung/react-native-code-push v11.0.0-rc5**](../README.md)
2
-
3
- ---
4
-
5
- [@appzung/react-native-code-push](../README.md) / checkForUpdate
6
-
7
- # Function: checkForUpdate()
8
-
9
- > **checkForUpdate**(`releaseChannelPublicId`?, `handleBinaryVersionMismatchCallback`?): `Promise`\<`null` \| [`RemotePackage`](../interfaces/RemotePackage.md)\>
10
-
11
- Asks the CodePush service whether the configured app release channel has an update available.
12
-
13
- ## Parameters
14
-
15
- ### releaseChannelPublicId?
16
-
17
- `string`
18
-
19
- The release channel public ID to use to query the CodePush server for an update.
20
-
21
- ### handleBinaryVersionMismatchCallback?
22
-
23
- [`HandleBinaryVersionMismatchCallback`](../type-aliases/HandleBinaryVersionMismatchCallback.md)
24
-
25
- An optional callback for handling target binary version mismatch
26
-
27
- ## Returns
28
-
29
- `Promise`\<`null` \| [`RemotePackage`](../interfaces/RemotePackage.md)\>
@@ -1,19 +0,0 @@
1
- [**@appzung/react-native-code-push v11.0.0-rc5**](../README.md)
2
-
3
- ---
4
-
5
- [@appzung/react-native-code-push](../README.md) / clearUpdates
6
-
7
- # Function: clearUpdates()
8
-
9
- > **clearUpdates**(): `void`
10
-
11
- Clears all downloaded CodePush updates.
12
-
13
- This is useful when switching to a different release channel which may have an older release than the current package.
14
- Note: we don’t recommend using this method in scenarios other than that (CodePush will call
15
- this method automatically when needed in other cases) as it could lead to unpredictable behavior.
16
-
17
- ## Returns
18
-
19
- `void`
@@ -1,17 +0,0 @@
1
- [**@appzung/react-native-code-push v11.0.0-rc5**](../README.md)
2
-
3
- ---
4
-
5
- [@appzung/react-native-code-push](../README.md) / disallowRestart
6
-
7
- # Function: disallowRestart()
8
-
9
- > **disallowRestart**(): `void`
10
-
11
- Forbid CodePush to restart the app.
12
-
13
- This is an advanced API, and is useful when a component within your app (for example an onboarding process) needs to ensure that no end-user interruptions can occur during its lifetime.
14
-
15
- ## Returns
16
-
17
- `void`
@@ -1,15 +0,0 @@
1
- [**@appzung/react-native-code-push v11.0.0-rc5**](../README.md)
2
-
3
- ---
4
-
5
- [@appzung/react-native-code-push](../README.md) / getClientUniqueId
6
-
7
- # Function: getClientUniqueId()
8
-
9
- > **getClientUniqueId**(): `Promise`\<`string`\>
10
-
11
- Gets the client's unique ID set by the module. You may also see `resetClientUniqueId`.
12
-
13
- ## Returns
14
-
15
- `Promise`\<`string`\>