@appzung/react-native-code-push 11.0.0-rc2 → 11.0.0-rc3

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 (181) hide show
  1. package/README.md +3 -3
  2. package/android/app/src/main/java/com/appzung/codepush/react/CodePushNativeModule.java +14 -0
  3. package/docs/api-js/README.md +55 -0
  4. package/docs/api-js/enumerations/CheckFrequency.md +33 -0
  5. package/docs/api-js/enumerations/DeploymentStatus.md +25 -0
  6. package/docs/api-js/enumerations/InstallMode.md +50 -0
  7. package/docs/api-js/enumerations/SyncStatus.md +85 -0
  8. package/docs/api-js/enumerations/UpdateState.md +37 -0
  9. package/docs/api-js/functions/allowRestart.md +17 -0
  10. package/docs/api-js/functions/checkForUpdate.md +29 -0
  11. package/docs/api-js/functions/clearUpdates.md +19 -0
  12. package/docs/api-js/functions/disallowRestart.md +17 -0
  13. package/docs/api-js/functions/getClientUniqueId.md +15 -0
  14. package/docs/api-js/functions/getUpdateMetadata.md +23 -0
  15. package/docs/api-js/functions/notifyAppReady.md +17 -0
  16. package/docs/api-js/functions/resetClientUniqueId.md +15 -0
  17. package/docs/api-js/functions/restartApp.md +25 -0
  18. package/docs/api-js/functions/sync.md +43 -0
  19. package/docs/api-js/functions/withCodePush.md +65 -0
  20. package/docs/api-js/interfaces/CodePushOptions.md +118 -0
  21. package/docs/api-js/interfaces/DownloadProgress.md +23 -0
  22. package/docs/api-js/interfaces/LocalPackage.md +171 -0
  23. package/docs/api-js/interfaces/Package.md +98 -0
  24. package/docs/api-js/interfaces/RemotePackage.md +169 -0
  25. package/docs/api-js/interfaces/RollbackRetryOptions.md +28 -0
  26. package/docs/api-js/interfaces/StatusReport.md +47 -0
  27. package/docs/api-js/interfaces/SyncOptions.md +80 -0
  28. package/docs/api-js/interfaces/UpdateDialog.md +89 -0
  29. package/docs/api-js/type-aliases/DownloadProgressCallback.md +21 -0
  30. package/docs/api-js/type-aliases/HandleBinaryVersionMismatchCallback.md +21 -0
  31. package/docs/api-js/type-aliases/SyncStatusChangedCallback.md +23 -0
  32. package/docs/api-js/variables/DEFAULT_UPDATE_DIALOG.md +12 -0
  33. package/docs/setup-android.md +1 -1
  34. package/docs/setup-ios.md +1 -1
  35. package/ios/CodePush/CodePush.h +1 -0
  36. package/ios/CodePush/CodePush.m +7 -0
  37. package/lib/commonjs/CodePush.js +6 -2
  38. package/lib/commonjs/CodePush.js.map +1 -1
  39. package/lib/commonjs/allowRestart.js +2 -0
  40. package/lib/commonjs/allowRestart.js.map +1 -1
  41. package/lib/commonjs/clearUpdates.js +2 -1
  42. package/lib/commonjs/clearUpdates.js.map +1 -1
  43. package/lib/commonjs/disallowRestart.js +2 -0
  44. package/lib/commonjs/disallowRestart.js.map +1 -1
  45. package/lib/commonjs/enums/CheckFrequency.enum.js +2 -2
  46. package/lib/commonjs/enums/InstallMode.enum.js +7 -3
  47. package/lib/commonjs/enums/InstallMode.enum.js.map +1 -1
  48. package/lib/commonjs/enums/SyncStatus.enum.js +7 -7
  49. package/lib/commonjs/enums/UpdateState.enum.js +7 -6
  50. package/lib/commonjs/enums/UpdateState.enum.js.map +1 -1
  51. package/lib/commonjs/getClientUniqueId.js +16 -0
  52. package/lib/commonjs/getClientUniqueId.js.map +1 -0
  53. package/lib/commonjs/index.js +24 -0
  54. package/lib/commonjs/index.js.map +1 -1
  55. package/lib/commonjs/internals/getConfiguration.js +4 -0
  56. package/lib/commonjs/internals/getConfiguration.js.map +1 -1
  57. package/lib/commonjs/internals/version.js +1 -1
  58. package/lib/commonjs/notifyAppReady.js +2 -0
  59. package/lib/commonjs/notifyAppReady.js.map +1 -1
  60. package/lib/commonjs/resetClientUniqueId.js +18 -0
  61. package/lib/commonjs/resetClientUniqueId.js.map +1 -0
  62. package/lib/commonjs/restartApp.js +2 -0
  63. package/lib/commonjs/restartApp.js.map +1 -1
  64. package/lib/commonjs/sync.js +5 -3
  65. package/lib/commonjs/sync.js.map +1 -1
  66. package/lib/module/CodePush.js +6 -2
  67. package/lib/module/CodePush.js.map +1 -1
  68. package/lib/module/allowRestart.js +2 -0
  69. package/lib/module/allowRestart.js.map +1 -1
  70. package/lib/module/clearUpdates.js +2 -1
  71. package/lib/module/clearUpdates.js.map +1 -1
  72. package/lib/module/disallowRestart.js +2 -0
  73. package/lib/module/disallowRestart.js.map +1 -1
  74. package/lib/module/enums/CheckFrequency.enum.js +2 -2
  75. package/lib/module/enums/InstallMode.enum.js +7 -3
  76. package/lib/module/enums/InstallMode.enum.js.map +1 -1
  77. package/lib/module/enums/SyncStatus.enum.js +7 -7
  78. package/lib/module/enums/UpdateState.enum.js +7 -6
  79. package/lib/module/enums/UpdateState.enum.js.map +1 -1
  80. package/lib/module/getClientUniqueId.js +12 -0
  81. package/lib/module/getClientUniqueId.js.map +1 -0
  82. package/lib/module/index.js +2 -0
  83. package/lib/module/index.js.map +1 -1
  84. package/lib/module/internals/getConfiguration.js +3 -0
  85. package/lib/module/internals/getConfiguration.js.map +1 -1
  86. package/lib/module/internals/version.js +1 -1
  87. package/lib/module/notifyAppReady.js +2 -0
  88. package/lib/module/notifyAppReady.js.map +1 -1
  89. package/lib/module/resetClientUniqueId.js +14 -0
  90. package/lib/module/resetClientUniqueId.js.map +1 -0
  91. package/lib/module/restartApp.js +2 -0
  92. package/lib/module/restartApp.js.map +1 -1
  93. package/lib/module/sync.js +5 -3
  94. package/lib/module/sync.js.map +1 -1
  95. package/lib/typescript/commonjs/src/CodePush.d.ts +10 -5
  96. package/lib/typescript/commonjs/src/CodePush.d.ts.map +1 -1
  97. package/lib/typescript/commonjs/src/allowRestart.d.ts +2 -0
  98. package/lib/typescript/commonjs/src/allowRestart.d.ts.map +1 -1
  99. package/lib/typescript/commonjs/src/clearUpdates.d.ts +2 -1
  100. package/lib/typescript/commonjs/src/clearUpdates.d.ts.map +1 -1
  101. package/lib/typescript/commonjs/src/disallowRestart.d.ts +2 -0
  102. package/lib/typescript/commonjs/src/disallowRestart.d.ts.map +1 -1
  103. package/lib/typescript/commonjs/src/enums/CheckFrequency.enum.d.ts +2 -2
  104. package/lib/typescript/commonjs/src/enums/InstallMode.enum.d.ts +7 -3
  105. package/lib/typescript/commonjs/src/enums/InstallMode.enum.d.ts.map +1 -1
  106. package/lib/typescript/commonjs/src/enums/SyncStatus.enum.d.ts +7 -7
  107. package/lib/typescript/commonjs/src/enums/UpdateState.enum.d.ts +7 -6
  108. package/lib/typescript/commonjs/src/enums/UpdateState.enum.d.ts.map +1 -1
  109. package/lib/typescript/commonjs/src/getClientUniqueId.d.ts +5 -0
  110. package/lib/typescript/commonjs/src/getClientUniqueId.d.ts.map +1 -0
  111. package/lib/typescript/commonjs/src/index.d.ts +2 -0
  112. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  113. package/lib/typescript/commonjs/src/internals/RNAppZungCodePushModuleSpec.d.ts +1 -0
  114. package/lib/typescript/commonjs/src/internals/RNAppZungCodePushModuleSpec.d.ts.map +1 -1
  115. package/lib/typescript/commonjs/src/internals/getConfiguration.d.ts +1 -0
  116. package/lib/typescript/commonjs/src/internals/getConfiguration.d.ts.map +1 -1
  117. package/lib/typescript/commonjs/src/internals/version.d.ts +1 -1
  118. package/lib/typescript/commonjs/src/notifyAppReady.d.ts +2 -0
  119. package/lib/typescript/commonjs/src/notifyAppReady.d.ts.map +1 -1
  120. package/lib/typescript/commonjs/src/resetClientUniqueId.d.ts +5 -0
  121. package/lib/typescript/commonjs/src/resetClientUniqueId.d.ts.map +1 -0
  122. package/lib/typescript/commonjs/src/restartApp.d.ts +2 -0
  123. package/lib/typescript/commonjs/src/restartApp.d.ts.map +1 -1
  124. package/lib/typescript/commonjs/src/sync.d.ts +3 -1
  125. package/lib/typescript/commonjs/src/sync.d.ts.map +1 -1
  126. package/lib/typescript/commonjs/src/types.d.ts +68 -26
  127. package/lib/typescript/commonjs/src/types.d.ts.map +1 -1
  128. package/lib/typescript/module/src/CodePush.d.ts +10 -5
  129. package/lib/typescript/module/src/CodePush.d.ts.map +1 -1
  130. package/lib/typescript/module/src/allowRestart.d.ts +2 -0
  131. package/lib/typescript/module/src/allowRestart.d.ts.map +1 -1
  132. package/lib/typescript/module/src/clearUpdates.d.ts +2 -1
  133. package/lib/typescript/module/src/clearUpdates.d.ts.map +1 -1
  134. package/lib/typescript/module/src/disallowRestart.d.ts +2 -0
  135. package/lib/typescript/module/src/disallowRestart.d.ts.map +1 -1
  136. package/lib/typescript/module/src/enums/CheckFrequency.enum.d.ts +2 -2
  137. package/lib/typescript/module/src/enums/InstallMode.enum.d.ts +7 -3
  138. package/lib/typescript/module/src/enums/InstallMode.enum.d.ts.map +1 -1
  139. package/lib/typescript/module/src/enums/SyncStatus.enum.d.ts +7 -7
  140. package/lib/typescript/module/src/enums/UpdateState.enum.d.ts +7 -6
  141. package/lib/typescript/module/src/enums/UpdateState.enum.d.ts.map +1 -1
  142. package/lib/typescript/module/src/getClientUniqueId.d.ts +5 -0
  143. package/lib/typescript/module/src/getClientUniqueId.d.ts.map +1 -0
  144. package/lib/typescript/module/src/index.d.ts +2 -0
  145. package/lib/typescript/module/src/index.d.ts.map +1 -1
  146. package/lib/typescript/module/src/internals/RNAppZungCodePushModuleSpec.d.ts +1 -0
  147. package/lib/typescript/module/src/internals/RNAppZungCodePushModuleSpec.d.ts.map +1 -1
  148. package/lib/typescript/module/src/internals/getConfiguration.d.ts +1 -0
  149. package/lib/typescript/module/src/internals/getConfiguration.d.ts.map +1 -1
  150. package/lib/typescript/module/src/internals/version.d.ts +1 -1
  151. package/lib/typescript/module/src/notifyAppReady.d.ts +2 -0
  152. package/lib/typescript/module/src/notifyAppReady.d.ts.map +1 -1
  153. package/lib/typescript/module/src/resetClientUniqueId.d.ts +5 -0
  154. package/lib/typescript/module/src/resetClientUniqueId.d.ts.map +1 -0
  155. package/lib/typescript/module/src/restartApp.d.ts +2 -0
  156. package/lib/typescript/module/src/restartApp.d.ts.map +1 -1
  157. package/lib/typescript/module/src/sync.d.ts +3 -1
  158. package/lib/typescript/module/src/sync.d.ts.map +1 -1
  159. package/lib/typescript/module/src/types.d.ts +68 -26
  160. package/lib/typescript/module/src/types.d.ts.map +1 -1
  161. package/package.json +4 -2
  162. package/src/CodePush.tsx +12 -5
  163. package/src/allowRestart.ts +2 -0
  164. package/src/clearUpdates.ts +2 -1
  165. package/src/disallowRestart.ts +2 -0
  166. package/src/enums/CheckFrequency.enum.ts +2 -2
  167. package/src/enums/InstallMode.enum.ts +7 -3
  168. package/src/enums/SyncStatus.enum.ts +7 -7
  169. package/src/enums/UpdateState.enum.ts +7 -6
  170. package/src/getClientUniqueId.ts +9 -0
  171. package/src/index.ts +2 -0
  172. package/src/internals/RNAppZungCodePushModuleSpec.ts +1 -0
  173. package/src/internals/getConfiguration.ts +4 -0
  174. package/src/internals/version.ts +1 -1
  175. package/src/notifyAppReady.ts +2 -0
  176. package/src/resetClientUniqueId.ts +11 -0
  177. package/src/restartApp.ts +2 -0
  178. package/src/sync.ts +5 -3
  179. package/src/types.ts +70 -26
  180. package/typedoc.json +9 -0
  181. package/docs/api-js.md +0 -557
package/README.md CHANGED
@@ -142,7 +142,7 @@ If you would like your app to discover updates more quickly, you can also choose
142
142
  withCodePush({ checkFrequency: CheckFrequency.ON_APP_RESUME })(MyApp);
143
143
  ```
144
144
 
145
- 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`:
145
+ 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/functions/sync.md) at any time with your desired `SyncOptions`, and turn off CodePush's automatic checking by specifying a manual `checkFrequency`:
146
146
 
147
147
  ```javascript
148
148
  import withCodePush, { CheckFrequency, InstallMode } from '@appzung/react-native-code-push';
@@ -169,7 +169,7 @@ class MyApp extends Component {
169
169
  export default withCodePush({ checkFrequency: CheckFrequency.MANUAL })(MyApp);
170
170
  ```
171
171
 
172
- 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.
172
+ 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 [`withCodePush()`](docs/api-js/functions/withCodePush.md) API reference for information on how to tweak this default behavior.
173
173
 
174
174
  ## Releasing updates
175
175
 
@@ -252,7 +252,7 @@ This is not necessarily the case for `updateDialog`, since it won't force the us
252
252
 
253
253
  ## API Reference
254
254
 
255
- - [JavaScript API](docs/api-js.md)
255
+ - [JavaScript API](docs/api-js/README.md)
256
256
  - [Objective-C API Reference (iOS)](docs/api-ios.md)
257
257
  - [Java API Reference (Android)](docs/api-android.md)
258
258
 
@@ -820,6 +820,20 @@ public class CodePushNativeModule extends BaseJavaModule {
820
820
  mCodePush.clearUpdates();
821
821
  }
822
822
 
823
+ @ReactMethod
824
+ public void resetClientUniqueId(Promise promise) {
825
+ try {
826
+ String newClientUniqueId = UUID.randomUUID().toString();
827
+ SharedPreferences preferences = mCodePush.getContext().getSharedPreferences(CodePushConstants.CODE_PUSH_PREFERENCES, 0);
828
+ preferences.edit().putString(CodePushConstants.CLIENT_UNIQUE_ID_KEY, newClientUniqueId).apply();
829
+ mClientUniqueId = newClientUniqueId;
830
+ promise.resolve(mClientUniqueId);
831
+ } catch (Exception e) {
832
+ CodePushUtils.log(e);
833
+ promise.reject(e);
834
+ }
835
+ }
836
+
823
837
  @ReactMethod
824
838
  public void addListener(String eventName) {
825
839
  // Set up any upstream listeners or background tasks as necessary
@@ -0,0 +1,55 @@
1
+ **@appzung/react-native-code-push v11.0.0-rc3**
2
+
3
+ ---
4
+
5
+ # @appzung/react-native-code-push v11.0.0-rc3
6
+
7
+ ## Enumerations
8
+
9
+ - [CheckFrequency](enumerations/CheckFrequency.md)
10
+ - [DeploymentStatus](enumerations/DeploymentStatus.md)
11
+ - [InstallMode](enumerations/InstallMode.md)
12
+ - [SyncStatus](enumerations/SyncStatus.md)
13
+ - [UpdateState](enumerations/UpdateState.md)
14
+
15
+ ## Interfaces
16
+
17
+ - [CodePushOptions](interfaces/CodePushOptions.md)
18
+ - [DownloadProgress](interfaces/DownloadProgress.md)
19
+ - [LocalPackage](interfaces/LocalPackage.md)
20
+ - [Package](interfaces/Package.md)
21
+ - [RemotePackage](interfaces/RemotePackage.md)
22
+ - [RollbackRetryOptions](interfaces/RollbackRetryOptions.md)
23
+ - [StatusReport](interfaces/StatusReport.md)
24
+ - [SyncOptions](interfaces/SyncOptions.md)
25
+ - [UpdateDialog](interfaces/UpdateDialog.md)
26
+
27
+ ## Type Aliases
28
+
29
+ - [DownloadProgressCallback](type-aliases/DownloadProgressCallback.md)
30
+ - [HandleBinaryVersionMismatchCallback](type-aliases/HandleBinaryVersionMismatchCallback.md)
31
+ - [SyncStatusChangedCallback](type-aliases/SyncStatusChangedCallback.md)
32
+
33
+ ## Variables
34
+
35
+ - [DEFAULT_UPDATE_DIALOG](variables/DEFAULT_UPDATE_DIALOG.md)
36
+
37
+ ## Functions
38
+
39
+ - [allowRestart](functions/allowRestart.md)
40
+ - [checkForUpdate](functions/checkForUpdate.md)
41
+ - [clearUpdates](functions/clearUpdates.md)
42
+ - [disallowRestart](functions/disallowRestart.md)
43
+ - [getClientUniqueId](functions/getClientUniqueId.md)
44
+ - [getUpdateMetadata](functions/getUpdateMetadata.md)
45
+ - [notifyAppReady](functions/notifyAppReady.md)
46
+ - [resetClientUniqueId](functions/resetClientUniqueId.md)
47
+ - [restartApp](functions/restartApp.md)
48
+ - [sync](functions/sync.md)
49
+ - [withCodePush](functions/withCodePush.md)
50
+
51
+ ## References
52
+
53
+ ### default
54
+
55
+ Renames and re-exports [withCodePush](functions/withCodePush.md)
@@ -0,0 +1,33 @@
1
+ [**@appzung/react-native-code-push v11.0.0-rc3**](../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).
@@ -0,0 +1,25 @@
1
+ [**@appzung/react-native-code-push v11.0.0-rc3**](../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.
@@ -0,0 +1,50 @@
1
+ [**@appzung/react-native-code-push v11.0.0-rc3**](../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.
@@ -0,0 +1,85 @@
1
+ [**@appzung/react-native-code-push v11.0.0-rc3**](../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`
@@ -0,0 +1,37 @@
1
+ [**@appzung/react-native-code-push v11.0.0-rc3**](../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.
@@ -0,0 +1,17 @@
1
+ [**@appzung/react-native-code-push v11.0.0-rc3**](../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`
@@ -0,0 +1,29 @@
1
+ [**@appzung/react-native-code-push v11.0.0-rc3**](../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)\>
@@ -0,0 +1,19 @@
1
+ [**@appzung/react-native-code-push v11.0.0-rc3**](../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`
@@ -0,0 +1,17 @@
1
+ [**@appzung/react-native-code-push v11.0.0-rc3**](../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`
@@ -0,0 +1,15 @@
1
+ [**@appzung/react-native-code-push v11.0.0-rc3**](../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`\>
@@ -0,0 +1,23 @@
1
+ [**@appzung/react-native-code-push v11.0.0-rc3**](../README.md)
2
+
3
+ ---
4
+
5
+ [@appzung/react-native-code-push](../README.md) / getUpdateMetadata
6
+
7
+ # Function: getUpdateMetadata()
8
+
9
+ > **getUpdateMetadata**(`updateState`?): `Promise`\<`null` \| [`LocalPackage`](../interfaces/LocalPackage.md)\>
10
+
11
+ Retrieves the metadata for an installed update (e.g. description, mandatory).
12
+
13
+ ## Parameters
14
+
15
+ ### updateState?
16
+
17
+ [`UpdateState`](../enumerations/UpdateState.md)
18
+
19
+ The state of the update you want to retrieve the metadata for. Defaults to UpdateState.RUNNING.
20
+
21
+ ## Returns
22
+
23
+ `Promise`\<`null` \| [`LocalPackage`](../interfaces/LocalPackage.md)\>
@@ -0,0 +1,17 @@
1
+ [**@appzung/react-native-code-push v11.0.0-rc3**](../README.md)
2
+
3
+ ---
4
+
5
+ [@appzung/react-native-code-push](../README.md) / notifyAppReady
6
+
7
+ # Function: notifyAppReady()
8
+
9
+ > **notifyAppReady**(): `Promise`\<`void` \| [`StatusReport`](../interfaces/StatusReport.md)\>
10
+
11
+ Notifies the CodePush runtime that an installed update is considered successful.
12
+
13
+ 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.
14
+
15
+ ## Returns
16
+
17
+ `Promise`\<`void` \| [`StatusReport`](../interfaces/StatusReport.md)\>
@@ -0,0 +1,15 @@
1
+ [**@appzung/react-native-code-push v11.0.0-rc3**](../README.md)
2
+
3
+ ---
4
+
5
+ [@appzung/react-native-code-push](../README.md) / resetClientUniqueId
6
+
7
+ # Function: resetClientUniqueId()
8
+
9
+ > **resetClientUniqueId**(): `Promise`\<`string`\>
10
+
11
+ Resets the client's unique ID. You may use this in some GDPR compliance scenarios. Note that this will create a new MAU if a new request is sent later.
12
+
13
+ ## Returns
14
+
15
+ `Promise`\<`string`\>
@@ -0,0 +1,25 @@
1
+ [**@appzung/react-native-code-push v11.0.0-rc3**](../README.md)
2
+
3
+ ---
4
+
5
+ [@appzung/react-native-code-push](../README.md) / restartApp
6
+
7
+ # Function: restartApp()
8
+
9
+ > **restartApp**(`onlyIfUpdateIsPending`): `Promise`\<`void`\>
10
+
11
+ Immediately restarts the app.
12
+
13
+ If there is an update pending, it will be immediately displayed to the end user. Otherwise, calling this method simply has the same behavior as the end user killing and restarting the process.
14
+
15
+ ## Parameters
16
+
17
+ ### onlyIfUpdateIsPending
18
+
19
+ `boolean` = `false`
20
+
21
+ Indicates whether you want the restart to no-op if there isn't currently a pending update.
22
+
23
+ ## Returns
24
+
25
+ `Promise`\<`void`\>
@@ -0,0 +1,43 @@
1
+ [**@appzung/react-native-code-push v11.0.0-rc3**](../README.md)
2
+
3
+ ---
4
+
5
+ [@appzung/react-native-code-push](../README.md) / sync
6
+
7
+ # Function: sync()
8
+
9
+ > **sync**(`options`?, `syncStatusChangedCallback`?, `downloadProgressCallback`?, `handleBinaryVersionMismatchCallback`?): `Promise`\<[`SyncStatus`](../enumerations/SyncStatus.md)\>
10
+
11
+ Allows checking for an update, downloading it and installing it, all with a single call.
12
+
13
+ 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.
14
+
15
+ ## Parameters
16
+
17
+ ### options?
18
+
19
+ [`SyncOptions`](../interfaces/SyncOptions.md)
20
+
21
+ Options used to configure the end-user update experience (e.g. show a prompt?, install the update immediately?).
22
+
23
+ ### syncStatusChangedCallback?
24
+
25
+ [`SyncStatusChangedCallback`](../type-aliases/SyncStatusChangedCallback.md)
26
+
27
+ An optional callback that allows tracking the status of the sync operation, as opposed to simply checking the resolved state via the returned Promise.
28
+
29
+ ### downloadProgressCallback?
30
+
31
+ [`DownloadProgressCallback`](../type-aliases/DownloadProgressCallback.md)
32
+
33
+ An optional callback that allows tracking the progress of an update while it is being downloaded.
34
+
35
+ ### handleBinaryVersionMismatchCallback?
36
+
37
+ [`HandleBinaryVersionMismatchCallback`](../type-aliases/HandleBinaryVersionMismatchCallback.md)
38
+
39
+ An optional callback for handling target binary version mismatch
40
+
41
+ ## Returns
42
+
43
+ `Promise`\<[`SyncStatus`](../enumerations/SyncStatus.md)\>
@@ -0,0 +1,65 @@
1
+ [**@appzung/react-native-code-push v11.0.0-rc3**](../README.md)
2
+
3
+ ---
4
+
5
+ [@appzung/react-native-code-push](../README.md) / withCodePush
6
+
7
+ # Function: withCodePush()
8
+
9
+ ## Call Signature
10
+
11
+ > **withCodePush**\<`P`\>(`component`): `ComponentType`
12
+
13
+ Wraps a React component inside a "higher order" React component that knows how to synchronize your app's JavaScript bundle and image assets when it is mounted.
14
+
15
+ Internally, the higher-order component calls `sync` inside its `componentDidMount` lifecycle handle, which in turns performs an update check, downloads the update if it exists and installs the update for you.
16
+
17
+ ### Type Parameters
18
+
19
+ • **P** _extends_ `object`
20
+
21
+ ### Parameters
22
+
23
+ #### component
24
+
25
+ `ComponentType`\<`P`\>
26
+
27
+ the React Component that will be decorated
28
+
29
+ ### Returns
30
+
31
+ `ComponentType`
32
+
33
+ ## Call Signature
34
+
35
+ > **withCodePush**\<`P`\>(`options`): (`component`) => `ComponentType`
36
+
37
+ Wraps a React component inside a "higher order" React component that knows how to synchronize your app's JavaScript bundle and image assets when it is mounted.
38
+
39
+ Internally, the higher-order component calls `sync` inside its `componentDidMount` lifecycle handle, which in turns performs an update check, downloads the update if it exists and installs the update for you.
40
+
41
+ ### Type Parameters
42
+
43
+ • **P** _extends_ `object`
44
+
45
+ ### Parameters
46
+
47
+ #### options
48
+
49
+ [`CodePushOptions`](../interfaces/CodePushOptions.md)
50
+
51
+ Options used to configure the end-user sync and update experience (e.g. when to check for updates?, show a prompt?, install the update immediately?).
52
+
53
+ ### Returns
54
+
55
+ `Function`
56
+
57
+ #### Parameters
58
+
59
+ ##### component
60
+
61
+ `ComponentType`\<`P`\>
62
+
63
+ #### Returns
64
+
65
+ `ComponentType`