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

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 (294) hide show
  1. package/README.md +10 -10
  2. package/android/app/src/main/java/com/appzung/codepush/react/CodePush.java +3 -0
  3. package/android/app/src/main/java/com/appzung/codepush/react/CodePushNativeModule.java +14 -0
  4. package/docs/advanced-usage.md +15 -0
  5. package/docs/api-js/README.md +55 -0
  6. package/docs/api-js/enumerations/CheckFrequency.md +33 -0
  7. package/docs/api-js/enumerations/DeploymentStatus.md +25 -0
  8. package/docs/api-js/enumerations/InstallMode.md +50 -0
  9. package/docs/api-js/enumerations/SyncStatus.md +85 -0
  10. package/docs/api-js/enumerations/UpdateState.md +37 -0
  11. package/docs/api-js/functions/allowRestart.md +17 -0
  12. package/docs/api-js/functions/checkForUpdate.md +29 -0
  13. package/docs/api-js/functions/clearUpdates.md +19 -0
  14. package/docs/api-js/functions/disallowRestart.md +17 -0
  15. package/docs/api-js/functions/getClientUniqueId.md +15 -0
  16. package/docs/api-js/functions/getUpdateMetadata.md +23 -0
  17. package/docs/api-js/functions/notifyAppReady.md +17 -0
  18. package/docs/api-js/functions/resetClientUniqueId.md +15 -0
  19. package/docs/api-js/functions/restartApp.md +25 -0
  20. package/docs/api-js/functions/sync.md +43 -0
  21. package/docs/api-js/functions/withCodePush.md +65 -0
  22. package/docs/api-js/interfaces/CodePushOptions.md +118 -0
  23. package/docs/api-js/interfaces/DownloadProgress.md +23 -0
  24. package/docs/api-js/interfaces/LocalPackage.md +171 -0
  25. package/docs/api-js/interfaces/Package.md +98 -0
  26. package/docs/api-js/interfaces/RemotePackage.md +169 -0
  27. package/docs/api-js/interfaces/RollbackRetryOptions.md +28 -0
  28. package/docs/api-js/interfaces/StatusReport.md +47 -0
  29. package/docs/api-js/interfaces/SyncOptions.md +80 -0
  30. package/docs/api-js/interfaces/UpdateDialog.md +89 -0
  31. package/docs/api-js/type-aliases/DownloadProgressCallback.md +21 -0
  32. package/docs/api-js/type-aliases/HandleBinaryVersionMismatchCallback.md +23 -0
  33. package/docs/api-js/type-aliases/SyncStatusChangedCallback.md +23 -0
  34. package/docs/api-js/variables/DEFAULT_UPDATE_DIALOG.md +12 -0
  35. package/docs/code-signing.md +2 -0
  36. package/docs/setup-android.md +1 -2
  37. package/docs/setup-ios.md +1 -1
  38. package/ios/CodePush/CodePush.h +1 -0
  39. package/ios/CodePush/CodePush.m +7 -0
  40. package/ios/CodePush/CodePushConfig.m +4 -0
  41. package/lib/commonjs/CodePush.js +6 -2
  42. package/lib/commonjs/CodePush.js.map +1 -1
  43. package/lib/commonjs/allowRestart.js +2 -0
  44. package/lib/commonjs/allowRestart.js.map +1 -1
  45. package/lib/commonjs/checkForUpdates.js +23 -25
  46. package/lib/commonjs/checkForUpdates.js.map +1 -1
  47. package/lib/commonjs/clearUpdates.js +2 -1
  48. package/lib/commonjs/clearUpdates.js.map +1 -1
  49. package/lib/commonjs/disallowRestart.js +2 -0
  50. package/lib/commonjs/disallowRestart.js.map +1 -1
  51. package/lib/commonjs/enums/CheckFrequency.enum.js +2 -2
  52. package/lib/commonjs/enums/InstallMode.enum.js +7 -3
  53. package/lib/commonjs/enums/InstallMode.enum.js.map +1 -1
  54. package/lib/commonjs/enums/SyncStatus.enum.js +7 -7
  55. package/lib/commonjs/enums/UpdateState.enum.js +7 -6
  56. package/lib/commonjs/enums/UpdateState.enum.js.map +1 -1
  57. package/lib/commonjs/getClientUniqueId.js +16 -0
  58. package/lib/commonjs/getClientUniqueId.js.map +1 -0
  59. package/lib/commonjs/index.js +34 -13
  60. package/lib/commonjs/index.js.map +1 -1
  61. package/lib/commonjs/internals/CodePushApiSdk.errors.js +26 -0
  62. package/lib/commonjs/internals/CodePushApiSdk.errors.js.map +1 -0
  63. package/lib/commonjs/internals/CodePushApiSdk.js +100 -0
  64. package/lib/commonjs/internals/CodePushApiSdk.js.map +1 -0
  65. package/lib/commonjs/{enums/DeploymentStatus.enum.js → internals/CodePushApiSdk.types.js} +3 -2
  66. package/lib/commonjs/internals/CodePushApiSdk.types.js.map +1 -0
  67. package/lib/commonjs/internals/RemotePackageImplementation.js +6 -5
  68. package/lib/commonjs/internals/RemotePackageImplementation.js.map +1 -1
  69. package/lib/commonjs/internals/getConfiguration.js +4 -0
  70. package/lib/commonjs/internals/getConfiguration.js.map +1 -1
  71. package/lib/commonjs/internals/utils/fetchRetry.js +59 -0
  72. package/lib/commonjs/internals/utils/fetchRetry.js.map +1 -0
  73. package/lib/commonjs/internals/utils/queryStringify.js +25 -0
  74. package/lib/commonjs/internals/utils/queryStringify.js.map +1 -0
  75. package/lib/commonjs/internals/utils/requestFetchAdapter.js +33 -0
  76. package/lib/commonjs/internals/utils/requestFetchAdapter.js.map +1 -0
  77. package/lib/commonjs/internals/version.js +1 -1
  78. package/lib/commonjs/notifyAppReady.js +11 -9
  79. package/lib/commonjs/notifyAppReady.js.map +1 -1
  80. package/lib/commonjs/resetClientUniqueId.js +18 -0
  81. package/lib/commonjs/resetClientUniqueId.js.map +1 -0
  82. package/lib/commonjs/restartApp.js +2 -0
  83. package/lib/commonjs/restartApp.js.map +1 -1
  84. package/lib/commonjs/sync.js +5 -3
  85. package/lib/commonjs/sync.js.map +1 -1
  86. package/lib/module/CodePush.js +6 -2
  87. package/lib/module/CodePush.js.map +1 -1
  88. package/lib/module/allowRestart.js +2 -0
  89. package/lib/module/allowRestart.js.map +1 -1
  90. package/lib/module/checkForUpdates.js +23 -25
  91. package/lib/module/checkForUpdates.js.map +1 -1
  92. package/lib/module/clearUpdates.js +2 -1
  93. package/lib/module/clearUpdates.js.map +1 -1
  94. package/lib/module/disallowRestart.js +2 -0
  95. package/lib/module/disallowRestart.js.map +1 -1
  96. package/lib/module/enums/CheckFrequency.enum.js +2 -2
  97. package/lib/module/enums/InstallMode.enum.js +7 -3
  98. package/lib/module/enums/InstallMode.enum.js.map +1 -1
  99. package/lib/module/enums/SyncStatus.enum.js +7 -7
  100. package/lib/module/enums/UpdateState.enum.js +7 -6
  101. package/lib/module/enums/UpdateState.enum.js.map +1 -1
  102. package/lib/module/getClientUniqueId.js +12 -0
  103. package/lib/module/getClientUniqueId.js.map +1 -0
  104. package/lib/module/index.js +3 -1
  105. package/lib/module/index.js.map +1 -1
  106. package/lib/module/internals/CodePushApiSdk.errors.js +20 -0
  107. package/lib/module/internals/CodePushApiSdk.errors.js.map +1 -0
  108. package/lib/module/internals/CodePushApiSdk.js +96 -0
  109. package/lib/module/internals/CodePushApiSdk.js.map +1 -0
  110. package/lib/module/{enums/DeploymentStatus.enum.js → internals/CodePushApiSdk.types.js} +2 -1
  111. package/lib/module/internals/CodePushApiSdk.types.js.map +1 -0
  112. package/lib/module/internals/RemotePackageImplementation.js +6 -5
  113. package/lib/module/internals/RemotePackageImplementation.js.map +1 -1
  114. package/lib/module/internals/getConfiguration.js +3 -0
  115. package/lib/module/internals/getConfiguration.js.map +1 -1
  116. package/lib/module/internals/utils/fetchRetry.js +55 -0
  117. package/lib/module/internals/utils/fetchRetry.js.map +1 -0
  118. package/lib/module/internals/utils/queryStringify.js +21 -0
  119. package/lib/module/internals/utils/queryStringify.js.map +1 -0
  120. package/lib/module/internals/utils/requestFetchAdapter.js +29 -0
  121. package/lib/module/internals/utils/requestFetchAdapter.js.map +1 -0
  122. package/lib/module/internals/version.js +1 -1
  123. package/lib/module/notifyAppReady.js +11 -9
  124. package/lib/module/notifyAppReady.js.map +1 -1
  125. package/lib/module/resetClientUniqueId.js +14 -0
  126. package/lib/module/resetClientUniqueId.js.map +1 -0
  127. package/lib/module/restartApp.js +2 -0
  128. package/lib/module/restartApp.js.map +1 -1
  129. package/lib/module/sync.js +5 -3
  130. package/lib/module/sync.js.map +1 -1
  131. package/lib/typescript/commonjs/src/CodePush.d.ts +10 -5
  132. package/lib/typescript/commonjs/src/CodePush.d.ts.map +1 -1
  133. package/lib/typescript/commonjs/src/allowRestart.d.ts +2 -0
  134. package/lib/typescript/commonjs/src/allowRestart.d.ts.map +1 -1
  135. package/lib/typescript/commonjs/src/checkForUpdates.d.ts.map +1 -1
  136. package/lib/typescript/commonjs/src/clearUpdates.d.ts +2 -1
  137. package/lib/typescript/commonjs/src/clearUpdates.d.ts.map +1 -1
  138. package/lib/typescript/commonjs/src/disallowRestart.d.ts +2 -0
  139. package/lib/typescript/commonjs/src/disallowRestart.d.ts.map +1 -1
  140. package/lib/typescript/commonjs/src/enums/CheckFrequency.enum.d.ts +2 -2
  141. package/lib/typescript/commonjs/src/enums/InstallMode.enum.d.ts +7 -3
  142. package/lib/typescript/commonjs/src/enums/InstallMode.enum.d.ts.map +1 -1
  143. package/lib/typescript/commonjs/src/enums/SyncStatus.enum.d.ts +7 -7
  144. package/lib/typescript/commonjs/src/enums/UpdateState.enum.d.ts +7 -6
  145. package/lib/typescript/commonjs/src/enums/UpdateState.enum.d.ts.map +1 -1
  146. package/lib/typescript/commonjs/src/getClientUniqueId.d.ts +5 -0
  147. package/lib/typescript/commonjs/src/getClientUniqueId.d.ts.map +1 -0
  148. package/lib/typescript/commonjs/src/index.d.ts +3 -1
  149. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  150. package/lib/typescript/commonjs/src/internals/CodePushApiSdk.d.ts +13 -0
  151. package/lib/typescript/commonjs/src/internals/CodePushApiSdk.d.ts.map +1 -0
  152. package/lib/typescript/commonjs/src/internals/CodePushApiSdk.errors.d.ts +9 -0
  153. package/lib/typescript/commonjs/src/internals/CodePushApiSdk.errors.d.ts.map +1 -0
  154. package/lib/typescript/commonjs/src/internals/CodePushApiSdk.types.d.ts +101 -0
  155. package/lib/typescript/commonjs/src/internals/CodePushApiSdk.types.d.ts.map +1 -0
  156. package/lib/typescript/commonjs/src/internals/RNAppZungCodePushModuleSpec.d.ts +1 -0
  157. package/lib/typescript/commonjs/src/internals/RNAppZungCodePushModuleSpec.d.ts.map +1 -1
  158. package/lib/typescript/commonjs/src/internals/RemotePackageImplementation.d.ts +2 -2
  159. package/lib/typescript/commonjs/src/internals/RemotePackageImplementation.d.ts.map +1 -1
  160. package/lib/typescript/commonjs/src/internals/getConfiguration.d.ts +1 -0
  161. package/lib/typescript/commonjs/src/internals/getConfiguration.d.ts.map +1 -1
  162. package/lib/typescript/commonjs/src/internals/types.d.ts +2 -2
  163. package/lib/typescript/commonjs/src/internals/types.d.ts.map +1 -1
  164. package/lib/typescript/commonjs/src/internals/utils/fetchRetry.d.ts +9 -0
  165. package/lib/typescript/commonjs/src/internals/utils/fetchRetry.d.ts.map +1 -0
  166. package/lib/typescript/commonjs/src/internals/utils/queryStringify.d.ts +4 -0
  167. package/lib/typescript/commonjs/src/internals/utils/queryStringify.d.ts.map +1 -0
  168. package/lib/typescript/commonjs/src/internals/utils/requestFetchAdapter.d.ts +3 -0
  169. package/lib/typescript/commonjs/src/internals/utils/requestFetchAdapter.d.ts.map +1 -0
  170. package/lib/typescript/commonjs/src/internals/version.d.ts +1 -1
  171. package/lib/typescript/commonjs/src/notifyAppReady.d.ts +2 -0
  172. package/lib/typescript/commonjs/src/notifyAppReady.d.ts.map +1 -1
  173. package/lib/typescript/commonjs/src/resetClientUniqueId.d.ts +5 -0
  174. package/lib/typescript/commonjs/src/resetClientUniqueId.d.ts.map +1 -0
  175. package/lib/typescript/commonjs/src/restartApp.d.ts +2 -0
  176. package/lib/typescript/commonjs/src/restartApp.d.ts.map +1 -1
  177. package/lib/typescript/commonjs/src/sync.d.ts +3 -1
  178. package/lib/typescript/commonjs/src/sync.d.ts.map +1 -1
  179. package/lib/typescript/commonjs/src/types.d.ts +72 -29
  180. package/lib/typescript/commonjs/src/types.d.ts.map +1 -1
  181. package/lib/typescript/module/src/CodePush.d.ts +10 -5
  182. package/lib/typescript/module/src/CodePush.d.ts.map +1 -1
  183. package/lib/typescript/module/src/allowRestart.d.ts +2 -0
  184. package/lib/typescript/module/src/allowRestart.d.ts.map +1 -1
  185. package/lib/typescript/module/src/checkForUpdates.d.ts.map +1 -1
  186. package/lib/typescript/module/src/clearUpdates.d.ts +2 -1
  187. package/lib/typescript/module/src/clearUpdates.d.ts.map +1 -1
  188. package/lib/typescript/module/src/disallowRestart.d.ts +2 -0
  189. package/lib/typescript/module/src/disallowRestart.d.ts.map +1 -1
  190. package/lib/typescript/module/src/enums/CheckFrequency.enum.d.ts +2 -2
  191. package/lib/typescript/module/src/enums/InstallMode.enum.d.ts +7 -3
  192. package/lib/typescript/module/src/enums/InstallMode.enum.d.ts.map +1 -1
  193. package/lib/typescript/module/src/enums/SyncStatus.enum.d.ts +7 -7
  194. package/lib/typescript/module/src/enums/UpdateState.enum.d.ts +7 -6
  195. package/lib/typescript/module/src/enums/UpdateState.enum.d.ts.map +1 -1
  196. package/lib/typescript/module/src/getClientUniqueId.d.ts +5 -0
  197. package/lib/typescript/module/src/getClientUniqueId.d.ts.map +1 -0
  198. package/lib/typescript/module/src/index.d.ts +3 -1
  199. package/lib/typescript/module/src/index.d.ts.map +1 -1
  200. package/lib/typescript/module/src/internals/CodePushApiSdk.d.ts +13 -0
  201. package/lib/typescript/module/src/internals/CodePushApiSdk.d.ts.map +1 -0
  202. package/lib/typescript/module/src/internals/CodePushApiSdk.errors.d.ts +9 -0
  203. package/lib/typescript/module/src/internals/CodePushApiSdk.errors.d.ts.map +1 -0
  204. package/lib/typescript/module/src/internals/CodePushApiSdk.types.d.ts +101 -0
  205. package/lib/typescript/module/src/internals/CodePushApiSdk.types.d.ts.map +1 -0
  206. package/lib/typescript/module/src/internals/RNAppZungCodePushModuleSpec.d.ts +1 -0
  207. package/lib/typescript/module/src/internals/RNAppZungCodePushModuleSpec.d.ts.map +1 -1
  208. package/lib/typescript/module/src/internals/RemotePackageImplementation.d.ts +2 -2
  209. package/lib/typescript/module/src/internals/RemotePackageImplementation.d.ts.map +1 -1
  210. package/lib/typescript/module/src/internals/getConfiguration.d.ts +1 -0
  211. package/lib/typescript/module/src/internals/getConfiguration.d.ts.map +1 -1
  212. package/lib/typescript/module/src/internals/types.d.ts +2 -2
  213. package/lib/typescript/module/src/internals/types.d.ts.map +1 -1
  214. package/lib/typescript/module/src/internals/utils/fetchRetry.d.ts +9 -0
  215. package/lib/typescript/module/src/internals/utils/fetchRetry.d.ts.map +1 -0
  216. package/lib/typescript/module/src/internals/utils/queryStringify.d.ts +4 -0
  217. package/lib/typescript/module/src/internals/utils/queryStringify.d.ts.map +1 -0
  218. package/lib/typescript/module/src/internals/utils/requestFetchAdapter.d.ts +3 -0
  219. package/lib/typescript/module/src/internals/utils/requestFetchAdapter.d.ts.map +1 -0
  220. package/lib/typescript/module/src/internals/version.d.ts +1 -1
  221. package/lib/typescript/module/src/notifyAppReady.d.ts +2 -0
  222. package/lib/typescript/module/src/notifyAppReady.d.ts.map +1 -1
  223. package/lib/typescript/module/src/resetClientUniqueId.d.ts +5 -0
  224. package/lib/typescript/module/src/resetClientUniqueId.d.ts.map +1 -0
  225. package/lib/typescript/module/src/restartApp.d.ts +2 -0
  226. package/lib/typescript/module/src/restartApp.d.ts.map +1 -1
  227. package/lib/typescript/module/src/sync.d.ts +3 -1
  228. package/lib/typescript/module/src/sync.d.ts.map +1 -1
  229. package/lib/typescript/module/src/types.d.ts +72 -29
  230. package/lib/typescript/module/src/types.d.ts.map +1 -1
  231. package/package.json +6 -4
  232. package/src/CodePush.tsx +12 -5
  233. package/src/allowRestart.ts +2 -0
  234. package/src/checkForUpdates.ts +24 -23
  235. package/src/clearUpdates.ts +2 -1
  236. package/src/disallowRestart.ts +2 -0
  237. package/src/enums/CheckFrequency.enum.ts +2 -2
  238. package/src/enums/InstallMode.enum.ts +7 -3
  239. package/src/enums/SyncStatus.enum.ts +7 -7
  240. package/src/enums/UpdateState.enum.ts +7 -6
  241. package/src/getClientUniqueId.ts +9 -0
  242. package/src/index.ts +3 -1
  243. package/src/internals/CodePushApiSdk.errors.ts +22 -0
  244. package/src/internals/CodePushApiSdk.ts +133 -0
  245. package/src/internals/CodePushApiSdk.types.ts +115 -0
  246. package/src/internals/RNAppZungCodePushModuleSpec.ts +1 -0
  247. package/src/internals/RemotePackageImplementation.ts +8 -7
  248. package/src/internals/getConfiguration.ts +4 -0
  249. package/src/internals/types.ts +2 -2
  250. package/src/internals/utils/fetchRetry.ts +72 -0
  251. package/src/internals/utils/queryStringify.ts +22 -0
  252. package/src/internals/utils/requestFetchAdapter.ts +28 -0
  253. package/src/internals/version.ts +1 -1
  254. package/src/notifyAppReady.ts +12 -13
  255. package/src/resetClientUniqueId.ts +11 -0
  256. package/src/restartApp.ts +2 -0
  257. package/src/sync.ts +5 -3
  258. package/src/types.ts +72 -29
  259. package/typedoc.json +9 -0
  260. package/docs/api-js.md +0 -557
  261. package/lib/commonjs/enums/DeploymentStatus.enum.js.map +0 -1
  262. package/lib/commonjs/internals/AcquisitionSdk.js +0 -9
  263. package/lib/commonjs/internals/AcquisitionSdk.js.map +0 -1
  264. package/lib/commonjs/internals/getPromisifiedSdk.js +0 -49
  265. package/lib/commonjs/internals/getPromisifiedSdk.js.map +0 -1
  266. package/lib/commonjs/internals/utils/request-fetch-adapter.js +0 -50
  267. package/lib/commonjs/internals/utils/request-fetch-adapter.js.map +0 -1
  268. package/lib/module/enums/DeploymentStatus.enum.js.map +0 -1
  269. package/lib/module/internals/AcquisitionSdk.js +0 -5
  270. package/lib/module/internals/AcquisitionSdk.js.map +0 -1
  271. package/lib/module/internals/getPromisifiedSdk.js +0 -45
  272. package/lib/module/internals/getPromisifiedSdk.js.map +0 -1
  273. package/lib/module/internals/utils/request-fetch-adapter.js +0 -46
  274. package/lib/module/internals/utils/request-fetch-adapter.js.map +0 -1
  275. package/lib/typescript/commonjs/src/enums/DeploymentStatus.enum.d.ts +0 -14
  276. package/lib/typescript/commonjs/src/enums/DeploymentStatus.enum.d.ts.map +0 -1
  277. package/lib/typescript/commonjs/src/internals/AcquisitionSdk.d.ts +0 -3
  278. package/lib/typescript/commonjs/src/internals/AcquisitionSdk.d.ts.map +0 -1
  279. package/lib/typescript/commonjs/src/internals/getPromisifiedSdk.d.ts +0 -13
  280. package/lib/typescript/commonjs/src/internals/getPromisifiedSdk.d.ts.map +0 -1
  281. package/lib/typescript/commonjs/src/internals/utils/request-fetch-adapter.d.ts +0 -3
  282. package/lib/typescript/commonjs/src/internals/utils/request-fetch-adapter.d.ts.map +0 -1
  283. package/lib/typescript/module/src/enums/DeploymentStatus.enum.d.ts +0 -14
  284. package/lib/typescript/module/src/enums/DeploymentStatus.enum.d.ts.map +0 -1
  285. package/lib/typescript/module/src/internals/AcquisitionSdk.d.ts +0 -3
  286. package/lib/typescript/module/src/internals/AcquisitionSdk.d.ts.map +0 -1
  287. package/lib/typescript/module/src/internals/getPromisifiedSdk.d.ts +0 -13
  288. package/lib/typescript/module/src/internals/getPromisifiedSdk.d.ts.map +0 -1
  289. package/lib/typescript/module/src/internals/utils/request-fetch-adapter.d.ts +0 -3
  290. package/lib/typescript/module/src/internals/utils/request-fetch-adapter.d.ts.map +0 -1
  291. package/src/enums/DeploymentStatus.enum.ts +0 -14
  292. package/src/internals/AcquisitionSdk.ts +0 -3
  293. package/src/internals/getPromisifiedSdk.ts +0 -72
  294. package/src/internals/utils/request-fetch-adapter.ts +0 -58
package/README.md CHANGED
@@ -55,13 +55,13 @@ Otherwise:
55
55
  npm install --save @appzung/react-native-code-push
56
56
  ```
57
57
 
58
- _NOTE: For Expo apps a plugin will be made available soon. In the meantime, you may eject._
59
-
60
58
  Then continue with installing the native module:
61
59
 
62
- - [iOS Setup](docs/setup-ios.md)
63
- - [Android Setup](docs/setup-android.md)
64
- - [Windows Setup](docs/setup-windows.md)
60
+ - [iOS setup](docs/setup-ios.md)
61
+ - [Android setup](docs/setup-android.md)
62
+ - [Windows setup](docs/setup-windows.md)
63
+
64
+ Or if your app is managed by the Expo framework, install and configure [@appzung/expo-config-code-push](https://github.com/AppZung/expo-config-code-push).
65
65
 
66
66
  ## Migrating to AppZung CodePush
67
67
 
@@ -142,14 +142,14 @@ 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
- import withCodePush, { CheckFrequency, InstallMode } from '@appzung/react-native-code-push';
148
+ import withCodePush, { CheckFrequency, InstallMode, sync } from '@appzung/react-native-code-push';
149
149
 
150
150
  class MyApp extends Component {
151
151
  onButtonPress() {
152
- CodePush.sync({
152
+ sync({
153
153
  updateDialog: true,
154
154
  installMode: InstallMode.IMMEDIATE,
155
155
  });
@@ -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
 
@@ -100,6 +100,9 @@ public class CodePush implements ReactPackage {
100
100
  }
101
101
 
102
102
  String serverUrlFromStrings = getCustomPropertyFromStringsIfExist("ServerUrl");
103
+ if (serverUrlFromStrings == null) {
104
+ serverUrlFromStrings = getCustomPropertyFromStringsIfExist("ServerURL");
105
+ }
103
106
  if (serverUrlFromStrings != null) {
104
107
  CodePushUtils.log("Executing CodePush with a custom server URL.");
105
108
  mServerUrl = serverUrlFromStrings;
@@ -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
@@ -54,3 +54,18 @@ With that change in place, now it's just a matter of choosing how your app deter
54
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
55
 
56
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.
@@ -0,0 +1,55 @@
1
+ **@appzung/react-native-code-push v11.0.0-rc4**
2
+
3
+ ---
4
+
5
+ # @appzung/react-native-code-push v11.0.0-rc4
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-rc4**](../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-rc4**](../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-rc4**](../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-rc4**](../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-rc4**](../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-rc4**](../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-rc4**](../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-rc4**](../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-rc4**](../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-rc4**](../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-rc4**](../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-rc4**](../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-rc4**](../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-rc4**](../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-rc4**](../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)\>