@appzung/react-native-code-push 10.0.0-rc1 → 10.0.1

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 (322) hide show
  1. package/CodePush.podspec +1 -0
  2. package/LICENSE.md +2 -2
  3. package/README.md +74 -95
  4. package/android/app/build.gradle +62 -18
  5. package/android/app/src/main/AndroidManifest.xml +2 -3
  6. package/android/app/src/main/AndroidManifestNew.xml +3 -0
  7. package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/CodePush.java +21 -89
  8. package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/CodePushNativeModule.java +32 -3
  9. package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/CodePushUpdateManager.java +2 -2
  10. package/android/build.gradle +1 -11
  11. package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
  12. package/android/gradle.properties +4 -20
  13. package/docs/advanced-usage.md +2 -2
  14. package/docs/api-android.md +12 -10
  15. package/docs/api-ios.md +5 -5
  16. package/docs/api-js.md +180 -178
  17. package/docs/code-signing.md +62 -0
  18. package/docs/migrating-to-v10.md +31 -0
  19. package/docs/setup-android.md +52 -79
  20. package/docs/setup-ios.md +31 -28
  21. package/docs/setup-windows.md +1 -0
  22. package/ios/CodePush/CodePush.m +13 -57
  23. package/lib/commonjs/CodePush.js +90 -0
  24. package/lib/commonjs/CodePush.js.map +1 -0
  25. package/lib/commonjs/allowRestart.js +12 -0
  26. package/lib/commonjs/allowRestart.js.map +1 -0
  27. package/lib/commonjs/checkForUpdates.js +105 -0
  28. package/lib/commonjs/checkForUpdates.js.map +1 -0
  29. package/lib/commonjs/clearUpdates.js +15 -0
  30. package/lib/commonjs/clearUpdates.js.map +1 -0
  31. package/lib/commonjs/disallowRestart.js +12 -0
  32. package/lib/commonjs/disallowRestart.js.map +1 -0
  33. package/lib/commonjs/enums/CheckFrequency.enum.js +25 -0
  34. package/lib/commonjs/enums/CheckFrequency.enum.js.map +1 -0
  35. package/lib/commonjs/enums/DeploymentStatus.enum.js +21 -0
  36. package/lib/commonjs/enums/DeploymentStatus.enum.js.map +1 -0
  37. package/lib/commonjs/enums/InstallMode.enum.js +35 -0
  38. package/lib/commonjs/enums/InstallMode.enum.js.map +1 -0
  39. package/lib/commonjs/enums/SyncStatus.enum.js +53 -0
  40. package/lib/commonjs/enums/SyncStatus.enum.js.map +1 -0
  41. package/lib/commonjs/enums/UpdateState.enum.js +29 -0
  42. package/lib/commonjs/enums/UpdateState.enum.js.map +1 -0
  43. package/lib/commonjs/getUpdateMetadata.js +25 -0
  44. package/lib/commonjs/getUpdateMetadata.js.map +1 -0
  45. package/lib/commonjs/index.js +195 -0
  46. package/lib/commonjs/index.js.map +1 -0
  47. package/lib/commonjs/internals/AcquisitionSdk.js +9 -0
  48. package/lib/commonjs/internals/AcquisitionSdk.js.map +1 -0
  49. package/lib/commonjs/internals/LocalPackageImplementation.js +29 -0
  50. package/lib/commonjs/internals/LocalPackageImplementation.js.map +1 -0
  51. package/lib/commonjs/internals/NativeRNAppZungCodePushModule.js +8 -0
  52. package/lib/commonjs/internals/NativeRNAppZungCodePushModule.js.map +1 -0
  53. package/lib/commonjs/internals/RNAppZungCodePushModuleSpec.js +6 -0
  54. package/lib/commonjs/internals/RNAppZungCodePushModuleSpec.js.map +1 -0
  55. package/lib/commonjs/internals/RemotePackageImplementation.js +49 -0
  56. package/lib/commonjs/internals/RemotePackageImplementation.js.map +1 -0
  57. package/lib/commonjs/internals/getConfiguration.js +15 -0
  58. package/lib/commonjs/internals/getConfiguration.js.map +1 -0
  59. package/lib/commonjs/internals/getCurrentPackage.js +12 -0
  60. package/lib/commonjs/internals/getCurrentPackage.js.map +1 -0
  61. package/lib/commonjs/internals/getPromisifiedSdk.js +49 -0
  62. package/lib/commonjs/internals/getPromisifiedSdk.js.map +1 -0
  63. package/lib/commonjs/internals/shouldUpdateBeIgnored.js +62 -0
  64. package/lib/commonjs/internals/shouldUpdateBeIgnored.js.map +1 -0
  65. package/lib/commonjs/internals/types.js +6 -0
  66. package/lib/commonjs/internals/types.js.map +1 -0
  67. package/lib/commonjs/internals/utils/log.js +11 -0
  68. package/lib/commonjs/internals/utils/log.js.map +1 -0
  69. package/lib/commonjs/internals/utils/request-fetch-adapter.js +50 -0
  70. package/lib/commonjs/internals/utils/request-fetch-adapter.js.map +1 -0
  71. package/lib/commonjs/internals/version.js +9 -0
  72. package/lib/commonjs/internals/version.js.map +1 -0
  73. package/lib/commonjs/notifyAppReady.js +83 -0
  74. package/lib/commonjs/notifyAppReady.js.map +1 -0
  75. package/lib/commonjs/reactNative.d.js +2 -0
  76. package/lib/commonjs/reactNative.d.js.map +1 -0
  77. package/lib/commonjs/restartApp.js +16 -0
  78. package/lib/commonjs/restartApp.js.map +1 -0
  79. package/lib/commonjs/sync.js +219 -0
  80. package/lib/commonjs/sync.js.map +1 -0
  81. package/lib/commonjs/types.js +6 -0
  82. package/lib/commonjs/types.js.map +1 -0
  83. package/lib/module/CodePush.js +84 -0
  84. package/lib/module/CodePush.js.map +1 -0
  85. package/lib/module/allowRestart.js +9 -0
  86. package/lib/module/allowRestart.js.map +1 -0
  87. package/lib/module/checkForUpdates.js +101 -0
  88. package/lib/module/checkForUpdates.js.map +1 -0
  89. package/lib/module/clearUpdates.js +12 -0
  90. package/lib/module/clearUpdates.js.map +1 -0
  91. package/lib/module/disallowRestart.js +9 -0
  92. package/lib/module/disallowRestart.js.map +1 -0
  93. package/lib/module/enums/CheckFrequency.enum.js +21 -0
  94. package/lib/module/enums/CheckFrequency.enum.js.map +1 -0
  95. package/lib/module/enums/DeploymentStatus.enum.js +17 -0
  96. package/lib/module/enums/DeploymentStatus.enum.js.map +1 -0
  97. package/lib/module/enums/InstallMode.enum.js +32 -0
  98. package/lib/module/enums/InstallMode.enum.js.map +1 -0
  99. package/lib/module/enums/SyncStatus.enum.js +49 -0
  100. package/lib/module/enums/SyncStatus.enum.js.map +1 -0
  101. package/lib/module/enums/UpdateState.enum.js +26 -0
  102. package/lib/module/enums/UpdateState.enum.js.map +1 -0
  103. package/lib/module/getUpdateMetadata.js +21 -0
  104. package/lib/module/getUpdateMetadata.js.map +1 -0
  105. package/lib/module/index.js +19 -0
  106. package/lib/module/index.js.map +1 -0
  107. package/lib/module/internals/AcquisitionSdk.js +5 -0
  108. package/lib/module/internals/AcquisitionSdk.js.map +1 -0
  109. package/lib/module/internals/LocalPackageImplementation.js +24 -0
  110. package/lib/module/internals/LocalPackageImplementation.js.map +1 -0
  111. package/lib/module/internals/NativeRNAppZungCodePushModule.js +4 -0
  112. package/lib/module/internals/NativeRNAppZungCodePushModule.js.map +1 -0
  113. package/lib/module/internals/RNAppZungCodePushModuleSpec.js +4 -0
  114. package/lib/module/internals/RNAppZungCodePushModuleSpec.js.map +1 -0
  115. package/lib/module/internals/RemotePackageImplementation.js +44 -0
  116. package/lib/module/internals/RemotePackageImplementation.js.map +1 -0
  117. package/lib/module/internals/getConfiguration.js +11 -0
  118. package/lib/module/internals/getConfiguration.js.map +1 -0
  119. package/lib/module/internals/getCurrentPackage.js +8 -0
  120. package/lib/module/internals/getCurrentPackage.js.map +1 -0
  121. package/lib/module/internals/getPromisifiedSdk.js +45 -0
  122. package/lib/module/internals/getPromisifiedSdk.js.map +1 -0
  123. package/lib/module/internals/shouldUpdateBeIgnored.js +58 -0
  124. package/lib/module/internals/shouldUpdateBeIgnored.js.map +1 -0
  125. package/lib/module/internals/types.js +4 -0
  126. package/lib/module/internals/types.js.map +1 -0
  127. package/lib/module/internals/utils/log.js +7 -0
  128. package/lib/module/internals/utils/log.js.map +1 -0
  129. package/lib/module/internals/utils/request-fetch-adapter.js +46 -0
  130. package/lib/module/internals/utils/request-fetch-adapter.js.map +1 -0
  131. package/lib/module/internals/version.js +5 -0
  132. package/lib/module/internals/version.js.map +1 -0
  133. package/lib/module/notifyAppReady.js +79 -0
  134. package/lib/module/notifyAppReady.js.map +1 -0
  135. package/lib/module/reactNative.d.js +2 -0
  136. package/lib/module/reactNative.d.js.map +1 -0
  137. package/lib/module/restartApp.js +13 -0
  138. package/lib/module/restartApp.js.map +1 -0
  139. package/lib/module/sync.js +215 -0
  140. package/lib/module/sync.js.map +1 -0
  141. package/lib/module/types.js +4 -0
  142. package/lib/module/types.js.map +1 -0
  143. package/lib/typescript/commonjs/package.json +1 -0
  144. package/lib/typescript/commonjs/src/CodePush.d.ts +24 -0
  145. package/lib/typescript/commonjs/src/CodePush.d.ts.map +1 -0
  146. package/lib/typescript/commonjs/src/allowRestart.d.ts +5 -0
  147. package/lib/typescript/commonjs/src/allowRestart.d.ts.map +1 -0
  148. package/lib/typescript/commonjs/src/checkForUpdates.d.ts +9 -0
  149. package/lib/typescript/commonjs/src/checkForUpdates.d.ts.map +1 -0
  150. package/lib/typescript/commonjs/src/clearUpdates.d.ts +8 -0
  151. package/lib/typescript/commonjs/src/clearUpdates.d.ts.map +1 -0
  152. package/lib/typescript/commonjs/src/disallowRestart.d.ts +5 -0
  153. package/lib/typescript/commonjs/src/disallowRestart.d.ts.map +1 -0
  154. package/lib/typescript/commonjs/src/enums/CheckFrequency.enum.d.ts +18 -0
  155. package/lib/typescript/commonjs/src/enums/CheckFrequency.enum.d.ts.map +1 -0
  156. package/lib/typescript/commonjs/src/enums/DeploymentStatus.enum.d.ts +14 -0
  157. package/lib/typescript/commonjs/src/enums/DeploymentStatus.enum.d.ts.map +1 -0
  158. package/lib/typescript/commonjs/src/enums/InstallMode.enum.d.ts +27 -0
  159. package/lib/typescript/commonjs/src/enums/InstallMode.enum.d.ts.map +1 -0
  160. package/lib/typescript/commonjs/src/enums/SyncStatus.enum.d.ts +46 -0
  161. package/lib/typescript/commonjs/src/enums/SyncStatus.enum.d.ts.map +1 -0
  162. package/lib/typescript/commonjs/src/enums/UpdateState.enum.d.ts +21 -0
  163. package/lib/typescript/commonjs/src/enums/UpdateState.enum.d.ts.map +1 -0
  164. package/lib/typescript/commonjs/src/getUpdateMetadata.d.ts +9 -0
  165. package/lib/typescript/commonjs/src/getUpdateMetadata.d.ts.map +1 -0
  166. package/lib/typescript/commonjs/src/index.d.ts +17 -0
  167. package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
  168. package/lib/typescript/commonjs/src/internals/AcquisitionSdk.d.ts +3 -0
  169. package/lib/typescript/commonjs/src/internals/AcquisitionSdk.d.ts.map +1 -0
  170. package/lib/typescript/commonjs/src/internals/LocalPackageImplementation.d.ts +17 -0
  171. package/lib/typescript/commonjs/src/internals/LocalPackageImplementation.d.ts.map +1 -0
  172. package/lib/typescript/commonjs/src/internals/NativeRNAppZungCodePushModule.d.ts +3 -0
  173. package/lib/typescript/commonjs/src/internals/NativeRNAppZungCodePushModule.d.ts.map +1 -0
  174. package/lib/typescript/commonjs/src/internals/RNAppZungCodePushModuleSpec.d.ts +36 -0
  175. package/lib/typescript/commonjs/src/internals/RNAppZungCodePushModuleSpec.d.ts.map +1 -0
  176. package/lib/typescript/commonjs/src/internals/RemotePackageImplementation.d.ts +18 -0
  177. package/lib/typescript/commonjs/src/internals/RemotePackageImplementation.d.ts.map +1 -0
  178. package/lib/typescript/commonjs/src/internals/getConfiguration.d.ts +3 -0
  179. package/lib/typescript/commonjs/src/internals/getConfiguration.d.ts.map +1 -0
  180. package/lib/typescript/commonjs/src/internals/getCurrentPackage.d.ts +2 -0
  181. package/lib/typescript/commonjs/src/internals/getCurrentPackage.d.ts.map +1 -0
  182. package/lib/typescript/commonjs/src/internals/getPromisifiedSdk.d.ts +13 -0
  183. package/lib/typescript/commonjs/src/internals/getPromisifiedSdk.d.ts.map +1 -0
  184. package/lib/typescript/commonjs/src/internals/shouldUpdateBeIgnored.d.ts +3 -0
  185. package/lib/typescript/commonjs/src/internals/shouldUpdateBeIgnored.d.ts.map +1 -0
  186. package/lib/typescript/commonjs/src/internals/types.d.ts +16 -0
  187. package/lib/typescript/commonjs/src/internals/types.d.ts.map +1 -0
  188. package/lib/typescript/commonjs/src/internals/utils/log.d.ts +2 -0
  189. package/lib/typescript/commonjs/src/internals/utils/log.d.ts.map +1 -0
  190. package/lib/typescript/commonjs/src/internals/utils/request-fetch-adapter.d.ts +3 -0
  191. package/lib/typescript/commonjs/src/internals/utils/request-fetch-adapter.d.ts.map +1 -0
  192. package/lib/typescript/commonjs/src/internals/version.d.ts +2 -0
  193. package/lib/typescript/commonjs/src/internals/version.d.ts.map +1 -0
  194. package/lib/typescript/commonjs/src/notifyAppReady.d.ts +6 -0
  195. package/lib/typescript/commonjs/src/notifyAppReady.d.ts.map +1 -0
  196. package/lib/typescript/commonjs/src/restartApp.d.ts +7 -0
  197. package/lib/typescript/commonjs/src/restartApp.d.ts.map +1 -0
  198. package/lib/typescript/commonjs/src/sync.d.ts +17 -0
  199. package/lib/typescript/commonjs/src/sync.d.ts.map +1 -0
  200. package/lib/typescript/commonjs/src/types.d.ts +196 -0
  201. package/lib/typescript/commonjs/src/types.d.ts.map +1 -0
  202. package/lib/typescript/module/package.json +1 -0
  203. package/lib/typescript/module/src/CodePush.d.ts +24 -0
  204. package/lib/typescript/module/src/CodePush.d.ts.map +1 -0
  205. package/lib/typescript/module/src/allowRestart.d.ts +5 -0
  206. package/lib/typescript/module/src/allowRestart.d.ts.map +1 -0
  207. package/lib/typescript/module/src/checkForUpdates.d.ts +9 -0
  208. package/lib/typescript/module/src/checkForUpdates.d.ts.map +1 -0
  209. package/lib/typescript/module/src/clearUpdates.d.ts +8 -0
  210. package/lib/typescript/module/src/clearUpdates.d.ts.map +1 -0
  211. package/lib/typescript/module/src/disallowRestart.d.ts +5 -0
  212. package/lib/typescript/module/src/disallowRestart.d.ts.map +1 -0
  213. package/lib/typescript/module/src/enums/CheckFrequency.enum.d.ts +18 -0
  214. package/lib/typescript/module/src/enums/CheckFrequency.enum.d.ts.map +1 -0
  215. package/lib/typescript/module/src/enums/DeploymentStatus.enum.d.ts +14 -0
  216. package/lib/typescript/module/src/enums/DeploymentStatus.enum.d.ts.map +1 -0
  217. package/lib/typescript/module/src/enums/InstallMode.enum.d.ts +27 -0
  218. package/lib/typescript/module/src/enums/InstallMode.enum.d.ts.map +1 -0
  219. package/lib/typescript/module/src/enums/SyncStatus.enum.d.ts +46 -0
  220. package/lib/typescript/module/src/enums/SyncStatus.enum.d.ts.map +1 -0
  221. package/lib/typescript/module/src/enums/UpdateState.enum.d.ts +21 -0
  222. package/lib/typescript/module/src/enums/UpdateState.enum.d.ts.map +1 -0
  223. package/lib/typescript/module/src/getUpdateMetadata.d.ts +9 -0
  224. package/lib/typescript/module/src/getUpdateMetadata.d.ts.map +1 -0
  225. package/lib/typescript/module/src/index.d.ts +17 -0
  226. package/lib/typescript/module/src/index.d.ts.map +1 -0
  227. package/lib/typescript/module/src/internals/AcquisitionSdk.d.ts +3 -0
  228. package/lib/typescript/module/src/internals/AcquisitionSdk.d.ts.map +1 -0
  229. package/lib/typescript/module/src/internals/LocalPackageImplementation.d.ts +17 -0
  230. package/lib/typescript/module/src/internals/LocalPackageImplementation.d.ts.map +1 -0
  231. package/lib/typescript/module/src/internals/NativeRNAppZungCodePushModule.d.ts +3 -0
  232. package/lib/typescript/module/src/internals/NativeRNAppZungCodePushModule.d.ts.map +1 -0
  233. package/lib/typescript/module/src/internals/RNAppZungCodePushModuleSpec.d.ts +36 -0
  234. package/lib/typescript/module/src/internals/RNAppZungCodePushModuleSpec.d.ts.map +1 -0
  235. package/lib/typescript/module/src/internals/RemotePackageImplementation.d.ts +18 -0
  236. package/lib/typescript/module/src/internals/RemotePackageImplementation.d.ts.map +1 -0
  237. package/lib/typescript/module/src/internals/getConfiguration.d.ts +3 -0
  238. package/lib/typescript/module/src/internals/getConfiguration.d.ts.map +1 -0
  239. package/lib/typescript/module/src/internals/getCurrentPackage.d.ts +2 -0
  240. package/lib/typescript/module/src/internals/getCurrentPackage.d.ts.map +1 -0
  241. package/lib/typescript/module/src/internals/getPromisifiedSdk.d.ts +13 -0
  242. package/lib/typescript/module/src/internals/getPromisifiedSdk.d.ts.map +1 -0
  243. package/lib/typescript/module/src/internals/shouldUpdateBeIgnored.d.ts +3 -0
  244. package/lib/typescript/module/src/internals/shouldUpdateBeIgnored.d.ts.map +1 -0
  245. package/lib/typescript/module/src/internals/types.d.ts +16 -0
  246. package/lib/typescript/module/src/internals/types.d.ts.map +1 -0
  247. package/lib/typescript/module/src/internals/utils/log.d.ts +2 -0
  248. package/lib/typescript/module/src/internals/utils/log.d.ts.map +1 -0
  249. package/lib/typescript/module/src/internals/utils/request-fetch-adapter.d.ts +3 -0
  250. package/lib/typescript/module/src/internals/utils/request-fetch-adapter.d.ts.map +1 -0
  251. package/lib/typescript/module/src/internals/version.d.ts +2 -0
  252. package/lib/typescript/module/src/internals/version.d.ts.map +1 -0
  253. package/lib/typescript/module/src/notifyAppReady.d.ts +6 -0
  254. package/lib/typescript/module/src/notifyAppReady.d.ts.map +1 -0
  255. package/lib/typescript/module/src/restartApp.d.ts +7 -0
  256. package/lib/typescript/module/src/restartApp.d.ts.map +1 -0
  257. package/lib/typescript/module/src/sync.d.ts +17 -0
  258. package/lib/typescript/module/src/sync.d.ts.map +1 -0
  259. package/lib/typescript/module/src/types.d.ts +196 -0
  260. package/lib/typescript/module/src/types.d.ts.map +1 -0
  261. package/package.json +58 -11
  262. package/react-native.config.js +8 -8
  263. package/src/CodePush.tsx +108 -0
  264. package/src/allowRestart.ts +6 -0
  265. package/src/checkForUpdates.ts +109 -0
  266. package/src/clearUpdates.ts +9 -0
  267. package/src/disallowRestart.ts +6 -0
  268. package/src/enums/CheckFrequency.enum.ts +19 -0
  269. package/src/enums/DeploymentStatus.enum.ts +14 -0
  270. package/src/enums/InstallMode.enum.ts +31 -0
  271. package/src/enums/SyncStatus.enum.ts +53 -0
  272. package/src/enums/UpdateState.enum.ts +24 -0
  273. package/src/getUpdateMetadata.ts +23 -0
  274. package/src/index.ts +18 -0
  275. package/src/internals/AcquisitionSdk.ts +3 -0
  276. package/src/internals/LocalPackageImplementation.ts +45 -0
  277. package/src/internals/NativeRNAppZungCodePushModule.ts +3 -0
  278. package/src/internals/RNAppZungCodePushModuleSpec.ts +54 -0
  279. package/src/internals/RemotePackageImplementation.ts +69 -0
  280. package/src/internals/getConfiguration.ts +12 -0
  281. package/src/internals/getCurrentPackage.ts +6 -0
  282. package/src/internals/getPromisifiedSdk.ts +72 -0
  283. package/src/internals/shouldUpdateBeIgnored.ts +76 -0
  284. package/src/internals/types.ts +18 -0
  285. package/{logging.js → src/internals/utils/log.ts} +1 -3
  286. package/src/internals/utils/request-fetch-adapter.ts +58 -0
  287. package/src/internals/version.ts +2 -0
  288. package/src/notifyAppReady.ts +94 -0
  289. package/src/reactNative.d.ts +34 -0
  290. package/src/restartApp.ts +10 -0
  291. package/src/sync.ts +272 -0
  292. package/src/types.ts +237 -0
  293. package/tsconfig.build.json +4 -0
  294. package/tsconfig.json +29 -12
  295. package/AlertAdapter.js +0 -24
  296. package/CONTRIBUTING.md +0 -134
  297. package/CodePush.js +0 -674
  298. package/android/app/.gradle/config.properties +0 -2
  299. package/android/app/local.properties +0 -8
  300. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushBuilder.java +0 -37
  301. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushDialog.java +0 -102
  302. package/package-mixins.js +0 -68
  303. package/request-fetch-adapter.js +0 -52
  304. package/tslint.json +0 -32
  305. package/typings/react-native-code-push.d.ts +0 -455
  306. /package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/CodePushConstants.java +0 -0
  307. /package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/CodePushInstallMode.java +0 -0
  308. /package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/CodePushInvalidPublicKeyException.java +0 -0
  309. /package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/CodePushInvalidUpdateException.java +0 -0
  310. /package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/CodePushMalformedDataException.java +0 -0
  311. /package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/CodePushNotInitializedException.java +0 -0
  312. /package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/CodePushTelemetryManager.java +0 -0
  313. /package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/CodePushUnknownException.java +0 -0
  314. /package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/CodePushUpdateState.java +0 -0
  315. /package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/CodePushUpdateUtils.java +0 -0
  316. /package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/CodePushUtils.java +0 -0
  317. /package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/DownloadProgress.java +0 -0
  318. /package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/DownloadProgressCallback.java +0 -0
  319. /package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/FileUtils.java +0 -0
  320. /package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/ReactInstanceHolder.java +0 -0
  321. /package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/SettingsManager.java +0 -0
  322. /package/android/app/src/main/java/com/{microsoft → appzung}/codepush/react/TLSSocketFactory.java +0 -0
package/docs/api-js.md CHANGED
@@ -12,23 +12,22 @@ The following sections describe the shape and behavior of these APIs in detail:
12
12
 
13
13
  When you require `react-native-code-push`, the module object provides the following top-level methods in addition to the root-level [component decorator](#codepush):
14
14
 
15
- * [allowRestart](#codepushallowrestart): Re-allows programmatic restarts to occur as a result of an update being installed, and optionally, immediately restarts the app if a pending update had attempted to restart the app while restarts were disallowed. This is an advanced API and is only necessary if your app explicitly disallowed restarts via the `disallowRestart` method.
15
+ - [allowRestart](#codepushallowrestart): Re-allows programmatic restarts to occur as a result of an update being installed, and optionally, immediately restarts the app if a pending update had attempted to restart the app while restarts were disallowed. This is an advanced API and is only necessary if your app explicitly disallowed restarts via the `disallowRestart` method.
16
16
 
17
- * [checkForUpdate](#codepushcheckforupdate): Asks the CodePush service whether the configured app release channel has an update available.
17
+ - [checkForUpdate](#codepushcheckforupdate): Asks the CodePush service whether the configured app release channel has an update available.
18
18
 
19
- * [disallowRestart](#codepushdisallowrestart): Temporarily disallows any programmatic restarts to occur as a result of a CodePush update being installed. 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.
19
+ - [disallowRestart](#codepushdisallowrestart): Temporarily disallows any programmatic restarts to occur as a result of a CodePush update being installed. 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.
20
20
 
21
- * [getUpdateMetadata](#codepushgetupdatemetadata): Retrieves the metadata for an installed update (like description, mandatory).
21
+ - [getUpdateMetadata](#codepushgetupdatemetadata): Retrieves the metadata for an installed update (like description, mandatory).
22
22
 
23
- * [notifyAppReady](#codepushnotifyappready): Notifies the CodePush runtime that an installed update is considered successful. If you are manually checking for and installing updates (i.e. not using the [sync](#codepushsync) 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.
23
+ - [notifyAppReady](#codepushnotifyappready): Notifies the CodePush runtime that an installed update is considered successful. If you are manually checking for and installing updates (i.e. not using the [sync](#codepushsync) 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.
24
24
 
25
- * [restartApp](#codepushrestartapp): Immediately restarts the app. 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.
25
+ - [restartApp](#codepushrestartapp): Immediately restarts the app. 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.
26
26
 
27
- * [sync](#codepushsync): Allows checking for an update, downloading it and installing it, all with a single call. Unless you need custom UI and/or behavior, we recommend most developers to use this method when integrating CodePush into their apps
27
+ - [sync](#codepushsync): Allows checking for an update, downloading it and installing it, all with a single call. Unless you need custom UI and/or behavior, we recommend most developers to use this method when integrating CodePush into their apps
28
28
 
29
- * [clearUpdates](#clearupdates): Clear all downloaded CodePush updates. This is useful when switching to a different release channel which may have an older release than the current package.
30
-
31
- _Note: we don’t recommend to use this method in scenarios other than that (CodePush will call this method automatically when needed in other cases) as it could lead to unpredictable behavior._
29
+ - [clearUpdates](#clearupdates): Clear all downloaded CodePush updates. This is useful when switching to a different release channel which may have an older release than the current package.
30
+ _Note: we don’t recommend to use this method in scenarios other than that (CodePush will call this method automatically when needed in other cases) as it could lead to unpredictable behavior._
32
31
 
33
32
  #### codePush
34
33
 
@@ -37,6 +36,7 @@ When you require `react-native-code-push`, the module object provides the follow
37
36
  codePush(rootComponent: React.Component): React.Component;
38
37
  codePush(options: CodePushOptions)(rootComponent: React.Component): React.Component;
39
38
  ```
39
+
40
40
  ```javascript
41
41
  // Decorator; Requires ES7 support
42
42
  @codePush
@@ -47,112 +47,112 @@ Used to wrap a React component inside a "higher order" React component that know
47
47
 
48
48
  This decorator provides support for letting you customize its behaviour to easily enable apps with different requirements. Below are some examples of ways you can use it (you can pick one or even use a combination):
49
49
 
50
- 1. **Silent sync on app start** *(the simplest, default behavior)*. Your app will automatically download available updates, and apply them the next time the app restarts (like the OS or end user killed it, or the device was restarted). This way, the entire update experience is "silent" to the end user, since they don't see any update prompt and/or "synthetic" app restarts.
50
+ 1. **Silent sync on app start** _(the simplest, default behavior)_. Your app will automatically download available updates, and apply them the next time the app restarts (like the OS or end user killed it, or the device was restarted). This way, the entire update experience is "silent" to the end user, since they don't see any update prompt and/or "synthetic" app restarts.
51
51
 
52
- ```javascript
53
- // Fully silent update which keeps the app in
54
- // sync with the server, without ever
55
- // interrupting the end user
56
- class MyApp extends Component<{}> {}
57
- MyApp = codePush(MyApp);
58
- export default MyApp;
59
- ```
52
+ ```javascript
53
+ // Fully silent update which keeps the app in
54
+ // sync with the server, without ever
55
+ // interrupting the end user
56
+ class MyApp extends Component<{}> {}
57
+ MyApp = codePush(MyApp);
58
+ export default MyApp;
59
+ ```
60
60
 
61
61
  2. **Silent sync every time the app resumes**. Same as 1, except we check for updates, or apply an update if one exists every time the app returns to the foreground after being "backgrounded".
62
62
 
63
- ```javascript
64
- // Sync for updates every time the app resumes.
65
- class MyApp extends Component<{}> {}
66
- MyApp = codePush({ checkFrequency: codePush.CheckFrequency.ON_APP_RESUME, installMode: codePush.InstallMode.ON_NEXT_RESUME })(MyApp);
67
- export default MyApp;
68
- ```
63
+ ```javascript
64
+ // Sync for updates every time the app resumes.
65
+ class MyApp extends Component<{}> {}
66
+ MyApp = codePush({ checkFrequency: codePush.CheckFrequency.ON_APP_RESUME, installMode: codePush.InstallMode.ON_NEXT_RESUME })(MyApp);
67
+ export default MyApp;
68
+ ```
69
69
 
70
70
  3. **Interactive**. When an update is available, prompt the end user for permission before downloading it, and then immediately apply the update. If an update was released using the `mandatory` flag, the end user would still be notified about the update, but they wouldn't have the choice to ignore it.
71
71
 
72
- ```javascript
73
- // Active update, which lets the end user know
74
- // about each update, and displays it to them
75
- // immediately after downloading it
76
- class MyApp extends Component<{}> {}
77
- MyApp = codePush({ updateDialog: true, installMode: codePush.InstallMode.IMMEDIATE })(MyApp);
78
- export default MyApp;
79
- ```
72
+ ```javascript
73
+ // Active update, which lets the end user know
74
+ // about each update, and displays it to them
75
+ // immediately after downloading it
76
+ class MyApp extends Component<{}> {}
77
+ MyApp = codePush({ updateDialog: true, installMode: codePush.InstallMode.IMMEDIATE })(MyApp);
78
+ export default MyApp;
79
+ ```
80
80
 
81
81
  4. **Log/display progress**. While the app is syncing with the server for updates, make use of the `codePushStatusDidChange` and/or `codePushDownloadDidProgress` event hooks to log down the different stages of this process, or even display a progress bar to the user.
82
82
 
83
- ```javascript
84
- // Make use of the event hooks to keep track of
85
- // the different stages of the sync process.
86
- class MyApp extends Component<{}> {
87
- codePushStatusDidChange(status) {
88
- switch(status) {
89
- case codePush.SyncStatus.CHECKING_FOR_UPDATE:
90
- console.log("Checking for updates.");
91
- break;
92
- case codePush.SyncStatus.DOWNLOADING_PACKAGE:
93
- console.log("Downloading package.");
94
- break;
95
- case codePush.SyncStatus.INSTALLING_UPDATE:
96
- console.log("Installing update.");
97
- break;
98
- case codePush.SyncStatus.UP_TO_DATE:
99
- console.log("Up-to-date.");
100
- break;
101
- case codePush.SyncStatus.UPDATE_INSTALLED:
102
- console.log("Update installed.");
103
- break;
104
- }
105
- }
106
-
107
- codePushDownloadDidProgress(progress) {
108
- console.log(progress.receivedBytes + " of " + progress.totalBytes + " received.");
109
- }
110
- }
111
- MyApp = codePush(MyApp);
112
- export default MyApp;
113
- ```
83
+ ```javascript
84
+ // Make use of the event hooks to keep track of
85
+ // the different stages of the sync process.
86
+ class MyApp extends Component<{}> {
87
+ codePushStatusDidChange(status) {
88
+ switch(status) {
89
+ case codePush.SyncStatus.CHECKING_FOR_UPDATE:
90
+ console.log("Checking for updates.");
91
+ break;
92
+ case codePush.SyncStatus.DOWNLOADING_PACKAGE:
93
+ console.log("Downloading package.");
94
+ break;
95
+ case codePush.SyncStatus.INSTALLING_UPDATE:
96
+ console.log("Installing update.");
97
+ break;
98
+ case codePush.SyncStatus.UP_TO_DATE:
99
+ console.log("Up-to-date.");
100
+ break;
101
+ case codePush.SyncStatus.UPDATE_INSTALLED:
102
+ console.log("Update installed.");
103
+ break;
104
+ }
105
+ }
106
+
107
+ codePushDownloadDidProgress(progress) {
108
+ console.log(progress.receivedBytes + " of " + progress.totalBytes + " received.");
109
+ }
110
+ }
111
+ MyApp = codePush(MyApp);
112
+ export default MyApp;
113
+ ```
114
114
 
115
115
  ##### CodePushOptions
116
116
 
117
117
  The `codePush` decorator accepts an "options" object that allows you to customize numerous aspects of the default behavior mentioned above:
118
118
 
119
- * __checkFrequency__ *(codePush.CheckFrequency)* - Specifies when you would like to check for updates. Defaults to `codePush.CheckFrequency.ON_APP_START`. Refer to the [`CheckFrequency`](#checkfrequency) enum reference for a description of the available options and what they do.
119
+ - **checkFrequency** _(codePush.CheckFrequency)_ - Specifies when you would like to check for updates. Defaults to `codePush.CheckFrequency.ON_APP_START`. Refer to the [`CheckFrequency`](#checkfrequency) enum reference for a description of the available options and what they do.
120
120
 
121
- * __releaseChannelPublicId__ *(String)* - Specifies the release channel public ID you want to query for an update against. By default, this value is derived from the `Info.plist` file (iOS) and strings resources (Android), but this option allows you to override it from the script-side if you need to dynamically use a different release channel.
121
+ - **releaseChannelPublicId** _(String)_ - Specifies the release channel public ID you want to query for an update against. By default, this value is derived from the `Info.plist` file (iOS) and strings resources (Android), but this option allows you to override it from the script-side if you need to dynamically use a different release channel.
122
122
 
123
- * __installMode__ *(codePush.InstallMode)* - Specifies when you would like to install optional updates (i.e. those that aren't marked as mandatory). Defaults to `codePush.InstallMode.ON_NEXT_RESTART`. Refer to the [`InstallMode`](#installmode) enum reference for a description of the available options and what they do.
123
+ - **installMode** _(codePush.InstallMode)_ - Specifies when you would like to install optional updates (i.e. those that aren't marked as mandatory). Defaults to `codePush.InstallMode.ON_NEXT_RESTART`. Refer to the [`InstallMode`](#installmode) enum reference for a description of the available options and what they do.
124
124
 
125
- * __mandatoryInstallMode__ *(codePush.InstallMode)* - Specifies when you would like to install updates which are marked as mandatory. Defaults to `codePush.InstallMode.IMMEDIATE`. Refer to the [`InstallMode`](#installmode) enum reference for a description of the available options and what they do.
125
+ - **mandatoryInstallMode** _(codePush.InstallMode)_ - Specifies when you would like to install updates which are marked as mandatory. Defaults to `codePush.InstallMode.IMMEDIATE`. Refer to the [`InstallMode`](#installmode) enum reference for a description of the available options and what they do.
126
126
 
127
- * __minimumBackgroundDuration__ *(Number)* - Specifies the minimum number of seconds that the app needs to have been in the background before restarting the app. This property only applies to updates which are installed using `InstallMode.ON_NEXT_RESUME` or `InstallMode.ON_NEXT_SUSPEND`, and can be useful for getting your update in front of end users sooner, without being too obtrusive. Defaults to `0`, which has the effect of applying the update immediately after a resume or unless the app suspension is long enough to not matter, regardless how long it was in the background.
127
+ - **minimumBackgroundDuration** _(Number)_ - Specifies the minimum number of seconds that the app needs to have been in the background before restarting the app. This property only applies to updates which are installed using `InstallMode.ON_NEXT_RESUME` or `InstallMode.ON_NEXT_SUSPEND`, and can be useful for getting your update in front of end users sooner, without being too obtrusive. Defaults to `0`, which has the effect of applying the update immediately after a resume or unless the app suspension is long enough to not matter, regardless how long it was in the background.
128
128
 
129
- * __updateDialog__ *(UpdateDialogOptions)* - An "options" object used to determine whether a confirmation dialog should be displayed to the end user when an update is available, and if so, what strings to use. Defaults to `null`, which has the effect of disabling the dialog completely. Setting this to any truthy value will enable the dialog with the default strings, and passing an object to this parameter allows enabling the dialog as well as overriding one or more of the default strings. Before enabling this option within an App Store-distributed app, please refer to [this note](https://github.com/appzung/react-native-code-push#app-store).
129
+ - **updateDialog** _(UpdateDialogOptions)_ - An "options" object used to determine whether a confirmation dialog should be displayed to the end user when an update is available, and if so, what strings to use. Defaults to `null`, which has the effect of disabling the dialog completely. Setting this to any truthy value will enable the dialog with the default strings, and passing an object to this parameter allows enabling the dialog as well as overriding one or more of the default strings. Before enabling this option within an App Store-distributed app, please refer to [this note](https://github.com/appzung/react-native-code-push#app-store).
130
130
 
131
- The following list represents the available options and their defaults:
131
+ The following list represents the available options and their defaults:
132
132
 
133
- * __appendReleaseDescription__ *(Boolean)* - Indicates whether you would like to append the description of an available release to the notification message which is displayed to the end user. Defaults to `false`.
133
+ - **appendReleaseDescription** _(Boolean)_ - Indicates whether you would like to append the description of an available release to the notification message which is displayed to the end user. Defaults to `false`.
134
134
 
135
- * __descriptionPrefix__ *(String)* - Indicates the string you would like to prefix the release description with, if any, when displaying the update notification to the end user. Defaults to `" Description: "`
135
+ - **descriptionPrefix** _(String)_ - Indicates the string you would like to prefix the release description with, if any, when displaying the update notification to the end user. Defaults to `" Description: "`
136
136
 
137
- * __mandatoryContinueButtonLabel__ *(String)* - The text to use for the button the end user must press in order to install a mandatory update. Defaults to `"Continue"`.
137
+ - **mandatoryContinueButtonLabel** _(String)_ - The text to use for the button the end user must press in order to install a mandatory update. Defaults to `"Continue"`.
138
138
 
139
- * __mandatoryUpdateMessage__ *(String)* - The text used as the body of an update notification, when the update is specified as mandatory. Defaults to `"An update is available that must be installed."`.
139
+ - **mandatoryUpdateMessage** _(String)_ - The text used as the body of an update notification, when the update is specified as mandatory. Defaults to `"An update is available that must be installed."`.
140
140
 
141
- * __optionalIgnoreButtonLabel__ *(String)* - The text to use for the button the end user can press in order to ignore an optional update that is available. Defaults to `"Ignore"`.
141
+ - **optionalIgnoreButtonLabel** _(String)_ - The text to use for the button the end user can press in order to ignore an optional update that is available. Defaults to `"Ignore"`.
142
142
 
143
- * __optionalInstallButtonLabel__ *(String)* - The text to use for the button the end user can press in order to install an optional update. Defaults to `"Install"`.
143
+ - **optionalInstallButtonLabel** _(String)_ - The text to use for the button the end user can press in order to install an optional update. Defaults to `"Install"`.
144
144
 
145
- * __optionalUpdateMessage__ *(String)* - The text used as the body of an update notification, when the update is optional. Defaults to `"An update is available. Would you like to install it?"`.
145
+ - **optionalUpdateMessage** _(String)_ - The text used as the body of an update notification, when the update is optional. Defaults to `"An update is available. Would you like to install it?"`.
146
146
 
147
- * __title__ *(String)* - The text used as the header of an update notification that is displayed to the end user. Defaults to `"Update available"`.
147
+ - **title** _(String)_ - The text used as the header of an update notification that is displayed to the end user. Defaults to `"Update available"`.
148
148
 
149
- * __rollbackRetryOptions__ *(RollbackRetryOptions)* - The rollback retry mechanism allows the application to attempt to reinstall an update that was previously rolled back (with the restrictions specified in the options). It is an "options" object used to determine whether a rollback retry should occur, and if so, what settings to use for the rollback retry. This defaults to null, which has the effect of disabling the retry mechanism. Setting this to any truthy value will enable the retry mechanism with the default settings, and passing an object to this parameter allows enabling the rollback retry as well as overriding one or more of the default values.
149
+ - **rollbackRetryOptions** _(RollbackRetryOptions)_ - The rollback retry mechanism allows the application to attempt to reinstall an update that was previously rolled back (with the restrictions specified in the options). It is an "options" object used to determine whether a rollback retry should occur, and if so, what settings to use for the rollback retry. This defaults to null, which has the effect of disabling the retry mechanism. Setting this to any truthy value will enable the retry mechanism with the default settings, and passing an object to this parameter allows enabling the rollback retry as well as overriding one or more of the default values.
150
150
 
151
- The following list represents the available options and their defaults:
151
+ The following list represents the available options and their defaults:
152
152
 
153
- * __delayInHours__ *(Number)* - Specifies the minimum time in hours that the app will wait after the latest rollback before attempting to reinstall the same rolled-back package. Defaults to `24`.
153
+ - **delayInHours** _(Number)_ - Specifies the minimum time in hours that the app will wait after the latest rollback before attempting to reinstall the same rolled-back package. Defaults to `24`.
154
154
 
155
- * __maxRetryAttempts__ *(Number)* - Specifies the maximum number of retry attempts that the app can make before it stops trying. Cannot be less than `1`. Defaults to `1`.
155
+ - **maxRetryAttempts** _(Number)_ - Specifies the maximum number of retry attempts that the app can make before it stops trying. Cannot be less than `1`. Defaults to `1`.
156
156
 
157
157
  ##### codePushStatusDidChange (event hook)
158
158
 
@@ -162,9 +162,9 @@ Called when the sync process moves from one stage to another in the overall upda
162
162
 
163
163
  Called periodically when an available update is being downloaded from the CodePush server. The method is called with a `DownloadProgress` object, which contains the following two properties:
164
164
 
165
- * __totalBytes__ *(Number)* - The total number of bytes expected to be received for this update (i.e. the size of the set of files which changed from the previous release).
165
+ - **totalBytes** _(Number)_ - The total number of bytes expected to be received for this update (i.e. the size of the set of files which changed from the previous release).
166
166
 
167
- * __receivedBytes__ *(Number)* - The number of bytes downloaded thus far, which can be used to track download progress.
167
+ - **receivedBytes** _(Number)_ - The number of bytes downloaded thus far, which can be used to track download progress.
168
168
 
169
169
  #### codePush.allowRestart
170
170
 
@@ -202,31 +202,31 @@ Second optional parameter `handleBinaryVersionMismatchCallback` is an optional c
202
202
  E.g. consider a use-case where currently installed binary version is 1.0.1 with label(codepush label) v1. Later native code was changed in the dev cycle and binary version was updated to 1.0.2. When code-push update check is triggered we ignore updates having binary version mismatch (because the update is not targeting to the binary version of currently installed app). In this case installed app (1.0.1) will ignore the update targeting version 1.0.2. You can use `handleBinaryVersionMismatchCallback` to provide a hook to handle such situations.
203
203
 
204
204
  **NOTE:**
205
- Be cautious to use Alerts within this callback if you are developing iOS application, due to [App Store](https://developer.apple.com/app-store/review/guidelines/) review process:
205
+ Be cautious to use Alerts within this callback if you are developing iOS application, due to [App Store](https://developer.apple.com/app-store/review/guidelines/) review process:
206
+
206
207
  > Apps must not force users to rate the app, review the app, download other apps, or other similar actions in order to access functionality, content, or use of the app.
207
208
 
208
209
  This method returns a `Promise` which resolves to one of two possible values:
209
210
 
210
211
  1. `null` if there is no update available. This can occur in the following scenarios:
211
212
 
212
- 1. The configured release channel doesn't contain any releases, and therefore, nothing to update.
213
- 2. The latest release within the configured release channel is targeting a different binary version than what you're currently running (either older or newer).
214
- 3. The currently running app already has the latest release from the configured release channel, and therefore, doesn't need it again.
215
- 4. The latest release within the configured release channel is currently marked as disabled, and therefore, isn't allowed to be downloaded.
216
- 5. The latest release within the configured release channel is in an "active rollout" state, and the requesting device doesn't fall within the percentage of users who are eligible for it.
213
+ 1. The configured release channel doesn't contain any releases, and therefore, nothing to update.
214
+ 2. The latest release within the configured release channel is targeting a different binary version than what you're currently running (either older or newer).
215
+ 3. The currently running app already has the latest release from the configured release channel, and therefore, doesn't need it again.
216
+ 4. The latest release within the configured release channel is currently marked as disabled, and therefore, isn't allowed to be downloaded.
217
+ 5. The latest release within the configured release channel is in an "active rollout" state, and the requesting device doesn't fall within the percentage of users who are eligible for it.
217
218
 
218
219
  2. A [`RemotePackage`](#remotepackage) instance which represents an available update that can be inspected and/or subsequently downloaded.
219
220
 
220
221
  Example Usage:
221
222
 
222
223
  ```javascript
223
- codePush.checkForUpdate()
224
- .then((update) => {
225
- if (!update) {
226
- console.log("The app is up to date!");
227
- } else {
228
- console.log("An update is available! Should we download it?");
229
- }
224
+ codePush.checkForUpdate().then((update) => {
225
+ if (!update) {
226
+ console.log('The app is up to date!');
227
+ } else {
228
+ console.log('An update is available! Should we download it?');
229
+ }
230
230
  });
231
231
  ```
232
232
 
@@ -242,7 +242,7 @@ Temporarily disallows programmatic restarts to occur as a result of either of fo
242
242
  2. A CodePush update is installed using `InstallMode.ON_NEXT_RESUME` and the app is resumed from the background (optionally being throttled by the `minimumBackgroundDuration` property)
243
243
  3. The `restartApp` method was called
244
244
 
245
- *NOTE: #1 and #2 effectively work by calling `restartApp` for you, so you can think of `disallowRestart` as blocking any call to `restartApp`, regardless if your app calls it directly or indirectly.*
245
+ _NOTE: #1 and #2 effectively work by calling `restartApp` for you, so you can think of `disallowRestart` as blocking any call to `restartApp`, regardless if your app calls it directly or indirectly._
246
246
 
247
247
  After calling this method, any calls to `sync` would still be allowed to check for an update, download it and install it, but an attempt to restart the app would be queued until `allowRestart` is called. This way, the restart request is captured and can be "flushed" whenever you want to allow it to occur.
248
248
 
@@ -285,13 +285,13 @@ This method returns a `Promise` which resolves to one of two possible values:
285
285
 
286
286
  1. `null` if an update with the specified state doesn't currently exist. This occurs in the following scenarios:
287
287
 
288
- 1. The end-user hasn't installed any CodePush updates yet, and therefore, no metadata is available for any updates, regardless what you specify as the `updateState` parameter.
288
+ 1. The end-user hasn't installed any CodePush updates yet, and therefore, no metadata is available for any updates, regardless what you specify as the `updateState` parameter.
289
289
 
290
- 2. The end-user installed an update of the binary (for example from the store), which cleared away the old CodePush updates, and gave precedence back to the JS binary in the binary. Therefore, it would exhibit the same behavior as #1
290
+ 2. The end-user installed an update of the binary (for example from the store), which cleared away the old CodePush updates, and gave precedence back to the JS binary in the binary. Therefore, it would exhibit the same behavior as #1
291
291
 
292
- 3. The `updateState` parameter is set to `UpdateState.RUNNING`, but the app isn't currently running a CodePush update. There may be a pending update, but the app hasn't been restarted yet in order to make it active.
292
+ 3. The `updateState` parameter is set to `UpdateState.RUNNING`, but the app isn't currently running a CodePush update. There may be a pending update, but the app hasn't been restarted yet in order to make it active.
293
293
 
294
- 4. The `updateState` parameter is set to `UpdateState.PENDING`, but the app doesn't have any currently pending updates.
294
+ 4. The `updateState` parameter is set to `UpdateState.PENDING`, but the app doesn't have any currently pending updates.
295
295
 
296
296
  2. A [`LocalPackage`](#localpackage) instance which represents the metadata for the currently requested CodePush update (either the running or pending).
297
297
 
@@ -302,16 +302,16 @@ Example Usage:
302
302
  // so, register it with the HockeyApp SDK (https://github.com/slowpath/react-native-hockeyapp)
303
303
  // so that crash reports will correctly display the JS bundle version the user was running.
304
304
  codePush.getUpdateMetadata().then((update) => {
305
- if (update) {
306
- hockeyApp.addMetadata({ CodePushRelease: update.label });
307
- }
305
+ if (update) {
306
+ hockeyApp.addMetadata({ CodePushRelease: update.label });
307
+ }
308
308
  });
309
309
 
310
310
  // Check to see if there is still an update pending.
311
311
  codePush.getUpdateMetadata(UpdateState.PENDING).then((update) => {
312
- if (update) {
313
- // There's a pending update, do we want to force a restart?
314
- }
312
+ if (update) {
313
+ // There's a pending update, do we want to force a restart?
314
+ }
315
315
  });
316
316
  ```
317
317
 
@@ -335,7 +335,7 @@ Immediately restarts the app. If a truthy value is provided to the `onlyIfUpdate
335
335
 
336
336
  This method is for advanced scenarios, and is primarily useful when the following conditions are true:
337
337
 
338
- 1. Your app is specifying an install mode value of `ON_NEXT_RESTART` or `ON_NEXT_RESUME` when calling the `sync` or `LocalPackage.install` methods. This has the effect of not applying your update until the app has been restarted (by either the end user or OS) or resumed, and therefore, the update won't be immediately displayed to the end user.
338
+ 1. Your app is specifying an install mode value of `ON_NEXT_RESTART` or `ON_NEXT_RESUME` when calling the `sync` or `LocalPackage.install` methods. This has the effect of not applying your update until the app has been restarted (by either the end user or OS) or resumed, and therefore, the update won't be immediately displayed to the end user.
339
339
 
340
340
  2. You have an app-specific user event (like the end user navigated back to the app's home route) that allows you to apply the update in an unobtrusive way, and potentially gets the update in front of the end user sooner then waiting until the next restart or resume.
341
341
 
@@ -349,7 +349,7 @@ Synchronizes your app's JavaScript bundle and image assets with the latest relea
349
349
 
350
350
  This method provides support for two different (but customizable) "modes" to easily enable apps with different requirements:
351
351
 
352
- 1. **Silent mode** *(the default behavior)*, which automatically downloads available updates, and applies them the next time the app restarts (for example the OS or end user killed it, or the device was restarted). This way, the entire update experience is "silent" to the end user, since they don't see any update prompt and/or "synthetic" app restarts.
352
+ 1. **Silent mode** _(the default behavior)_, which automatically downloads available updates, and applies them the next time the app restarts (for example the OS or end user killed it, or the device was restarted). This way, the entire update experience is "silent" to the end user, since they don't see any update prompt and/or "synthetic" app restarts.
353
353
 
354
354
  2. **Active mode**, which when an update is available, prompts the end user for permission before downloading it, and then immediately applies the update. If an update was released using the `mandatory` flag, the end user would still be notified about the update, but they wouldn't have the choice to ignore it.
355
355
 
@@ -367,21 +367,21 @@ codePush.sync();
367
367
  codePush.sync({ updateDialog: true, installMode: codePush.InstallMode.IMMEDIATE });
368
368
  ```
369
369
 
370
- *Note: If you want to decide whether you check and/or download an available update based on the end user's device battery level, network conditions, etc. then simply wrap the call to `sync` in a condition that ensures you only call it when desired.*
370
+ _Note: If you want to decide whether you check and/or download an available update based on the end user's device battery level, network conditions, etc. then simply wrap the call to `sync` in a condition that ensures you only call it when desired._
371
371
 
372
372
  ##### SyncOptions
373
373
 
374
374
  While the `sync` method tries to make it easy to perform silent and active updates with little configuration, it accepts an "options" object that allows you to customize numerous aspects of the default behavior mentioned above. The options available are identical to the [CodePushOptions](#codepushoptions), with the exception of the `checkFrequency` option:
375
375
 
376
- * __releaseChannelPublicId__ *(String)* - Refer to [`CodePushOptions`](#codepushoptions).
376
+ - **releaseChannelPublicId** _(String)_ - Refer to [`CodePushOptions`](#codepushoptions).
377
377
 
378
- * __installMode__ *(codePush.InstallMode)* - Refer to [`CodePushOptions`](#codepushoptions).
378
+ - **installMode** _(codePush.InstallMode)_ - Refer to [`CodePushOptions`](#codepushoptions).
379
379
 
380
- * __mandatoryInstallMode__ *(codePush.InstallMode)* - Refer to [`CodePushOptions`](#codepushoptions).
380
+ - **mandatoryInstallMode** _(codePush.InstallMode)_ - Refer to [`CodePushOptions`](#codepushoptions).
381
381
 
382
- * __minimumBackgroundDuration__ *(Number)* - Refer to [`CodePushOptions`](#codepushoptions).
382
+ - **minimumBackgroundDuration** _(Number)_ - Refer to [`CodePushOptions`](#codepushoptions).
383
383
 
384
- * __updateDialog__ *(UpdateDialogOptions)* - Refer to [`CodePushOptions`](#codepushoptions).
384
+ - **updateDialog** _(UpdateDialogOptions)_ - Refer to [`CodePushOptions`](#codepushoptions).
385
385
 
386
386
  Example Usage:
387
387
 
@@ -389,7 +389,7 @@ Example Usage:
389
389
  // Use a different release channel public ID for this
390
390
  // specific call, instead of the one configured
391
391
  // in the Info.plist file
392
- codePush.sync({ releaseChannelPublicId: "KEY" });
392
+ codePush.sync({ releaseChannelPublicId: 'KEY' });
393
393
 
394
394
  // Download the update silently, but install it on
395
395
  // the next resume, as long as at least 5 minutes
@@ -402,63 +402,64 @@ codePush.sync({ mandatoryInstallMode: codePush.InstallMode.ON_NEXT_RESUME });
402
402
 
403
403
  // Changing the title displayed in the
404
404
  // confirmation dialog of an "active" update
405
- codePush.sync({ updateDialog: { title: "An update is available!" } });
405
+ codePush.sync({ updateDialog: { title: 'An update is available!' } });
406
406
 
407
407
  // Displaying an update prompt which includes the
408
408
  // description associated with the CodePush release
409
409
  codePush.sync({
410
- updateDialog: {
410
+ updateDialog: {
411
411
  appendReleaseDescription: true,
412
- descriptionPrefix: "\n\nChange log:\n"
413
- },
414
- installMode: codePush.InstallMode.IMMEDIATE
412
+ descriptionPrefix: '\n\nChange log:\n',
413
+ },
414
+ installMode: codePush.InstallMode.IMMEDIATE,
415
415
  });
416
416
  ```
417
417
 
418
418
  In addition to the options, the `sync` method also accepts several optional function parameters which allow you to subscribe to the lifecycle of the `sync` "pipeline" in order to display additional UI as needed (like a "checking for update modal or a download progress modal):
419
419
 
420
- * __syncStatusChangedCallback__ *((syncStatus: Number) => void)* - Called when the sync process moves from one stage to another in the overall update process. The method is called with a status code which represents the current state, and can be any of the [`SyncStatus`](#syncstatus) values.
420
+ - **syncStatusChangedCallback** _((syncStatus: Number) => void)_ - Called when the sync process moves from one stage to another in the overall update process. The method is called with a status code which represents the current state, and can be any of the [`SyncStatus`](#syncstatus) values.
421
421
 
422
- * __downloadProgressCallback__ *((progress: DownloadProgress) => void)* - Called periodically when an available update is being downloaded from the CodePush server. The method is called with a `DownloadProgress` object, which contains the following two properties:
422
+ - **downloadProgressCallback** _((progress: DownloadProgress) => void)_ - Called periodically when an available update is being downloaded from the CodePush server. The method is called with a `DownloadProgress` object, which contains the following two properties:
423
423
 
424
- * __totalBytes__ *(Number)* - The total number of bytes expected to be received for this update (i.e. the size of the set of files which changed from the previous release).
424
+ - **totalBytes** _(Number)_ - The total number of bytes expected to be received for this update (i.e. the size of the set of files which changed from the previous release).
425
425
 
426
- * __receivedBytes__ *(Number)* - The number of bytes downloaded thus far, which can be used to track download progress.
426
+ - **receivedBytes** _(Number)_ - The number of bytes downloaded thus far, which can be used to track download progress.
427
427
 
428
- * __handleBinaryVersionMismatchCallback__ *((update: RemotePackage) => void)* -
429
- Called when there are any binary update available. The method is called with a [`RemotePackage`](#remotepackage) object. Refer to [codePush.checkForUpdate](#codepushcheckforupdate) section for more details.
428
+ - **handleBinaryVersionMismatchCallback** _((update: RemotePackage) => void)_ -
429
+ Called when there are any binary update available. The method is called with a [`RemotePackage`](#remotepackage) object. Refer to [codePush.checkForUpdate](#codepushcheckforupdate) section for more details.
430
430
 
431
431
  Example Usage:
432
432
 
433
433
  ```javascript
434
434
  // Prompt the user when an update is available
435
435
  // and then display a "downloading" modal
436
- codePush.sync({ updateDialog: true },
436
+ codePush.sync(
437
+ { updateDialog: true },
437
438
  (status) => {
438
- switch (status) {
439
- case codePush.SyncStatus.DOWNLOADING_PACKAGE:
440
- // Show "downloading" modal
441
- break;
442
- case codePush.SyncStatus.INSTALLING_UPDATE:
443
- // Hide "downloading" modal
444
- break;
445
- }
439
+ switch (status) {
440
+ case codePush.SyncStatus.DOWNLOADING_PACKAGE:
441
+ // Show "downloading" modal
442
+ break;
443
+ case codePush.SyncStatus.INSTALLING_UPDATE:
444
+ // Hide "downloading" modal
445
+ break;
446
+ }
446
447
  },
447
- ({ receivedBytes, totalBytes, }) => {
448
+ ({ receivedBytes, totalBytes }) => {
448
449
  /* Update download modal progress */
449
- }
450
+ },
450
451
  );
451
452
  ```
452
453
 
453
454
  This method returns a `Promise` which is resolved to a `SyncStatus` code that indicates why the `sync` call succeeded. This code can be one of the following `SyncStatus` values:
454
455
 
455
- * __codePush.SyncStatus.UP_TO_DATE__ *(0)* - The app is up-to-date with the CodePush server.
456
+ - **codePush.SyncStatus.UP_TO_DATE** _(0)_ - The app is up-to-date with the CodePush server.
456
457
 
457
- * __codePush.SyncStatus.UPDATE_IGNORED__ *(2)* - The app had an optional update which the end user chose to ignore. (This is only applicable when the `updateDialog` is used)
458
+ - **codePush.SyncStatus.UPDATE_IGNORED** _(2)_ - The app had an optional update which the end user chose to ignore. (This is only applicable when the `updateDialog` is used)
458
459
 
459
- * __codePush.SyncStatus.UPDATE_INSTALLED__ *(1)* - The update has been installed and will be run either immediately after the `syncStatusChangedCallback` function returns or the next time the app resumes/restarts, depending on the `InstallMode` specified in `SyncOptions`.
460
+ - **codePush.SyncStatus.UPDATE_INSTALLED** _(1)_ - The update has been installed and will be run either immediately after the `syncStatusChangedCallback` function returns or the next time the app resumes/restarts, depending on the `InstallMode` specified in `SyncOptions`.
460
461
 
461
- * __codePush.SyncStatus.SYNC_IN_PROGRESS__ *(4)* - There is an ongoing `sync` operation running which prevents the current call from being executed.
462
+ - **codePush.SyncStatus.SYNC_IN_PROGRESS** _(4)_ - There is an ongoing `sync` operation running which prevents the current call from being executed.
462
463
 
463
464
  The `sync` method can be called anywhere you'd like to check for an update. That could be in the `componentWillMount` lifecycle event of your root component, the onPress handler of a `<TouchableHighlight>` component, in the callback of a periodic timer, or whatever else makes sense for your needs. Just like the `checkForUpdate` method, it will perform the network request to check for an update in the background, so it won't impact your UI thread and/or JavaScript thread's responsiveness.
464
465
 
@@ -466,29 +467,30 @@ The `sync` method can be called anywhere you'd like to check for an update. That
466
467
 
467
468
  The `checkForUpdate` and `getUpdateMetadata` methods return `Promise` objects, that when resolved, provide acces to "package" objects. The package represents your code update as well as any extra metadata (like description, mandatory?). The CodePush API has the distinction between the following types of packages:
468
469
 
469
- * [LocalPackage](#localpackage): Represents a downloaded update that is either already running, or has been installed and is pending an app restart.
470
+ - [LocalPackage](#localpackage): Represents a downloaded update that is either already running, or has been installed and is pending an app restart.
470
471
 
471
- * [RemotePackage](#remotepackage): Represents an available update on the CodePush server that hasn't been downloaded yet.
472
+ - [RemotePackage](#remotepackage): Represents an available update on the CodePush server that hasn't been downloaded yet.
472
473
 
473
474
  ##### LocalPackage
474
475
 
475
476
  Contains details about an update that has been downloaded locally or already installed. You can get a reference to an instance of this object either by calling the module-level `getUpdateMetadata` method, or as the value of the promise returned by the `RemotePackage.download` method.
476
477
 
477
478
  ###### Properties
478
- - __appVersion__: The app binary version that this update is dependent on. This is the value that was specified via the `appStoreVersion` parameter when calling the CLI's `release` command. *(String)*
479
- - __releaseChannelPublicId__: The release channel that was used to originally download this update. *(String)*
480
- - __description__: The description of the update. This is the same value that you specified in the CLI when you released the update. *(String)*
481
- - __failedInstall__: Indicates whether this update has been previously installed but was rolled back. The `sync` method will automatically ignore updates which have previously failed, so you only need to worry about this property if using `checkForUpdate`. *(Boolean)*
482
- - __isFirstRun__: Indicates whether this is the first time the update has been run after being installed. This is useful for determining whether you would like to show a "What's New?" UI to the end user after installing an update. *(Boolean)*
483
- - __isMandatory__: Indicates whether the update is considered mandatory. This is the value that was specified in the CLI when the update was released. *(Boolean)*
484
- - __isPending__: Indicates whether this update is in a "pending" state. When `true`, that means the update has been downloaded and installed, but the app restart needed to apply it hasn't occurred yet, and therefore, it's changes aren't currently visible to the end-user. *(Boolean)*
485
- - __label__: The internal label automatically given to the update by the CodePush server, such as `v5`. This value uniquely identifies the update within its release channel. *(String)*
486
- - __packageHash__: The SHA hash value of the update. *(String)*
487
- - __packageSize__: The size of the code contained within the update, in bytes. *(Number)*
479
+
480
+ - **appVersion**: The app binary version that this update is dependent on. This is the value that was specified via the `appStoreVersion` parameter when calling the CLI's `release` command. _(String)_
481
+ - **releaseChannelPublicId**: The release channel that was used to originally download this update. _(String)_
482
+ - **description**: The description of the update. This is the same value that you specified in the CLI when you released the update. _(String)_
483
+ - **failedInstall**: Indicates whether this update has been previously installed but was rolled back. The `sync` method will automatically ignore updates which have previously failed, so you only need to worry about this property if using `checkForUpdate`. _(Boolean)_
484
+ - **isFirstRun**: Indicates whether this is the first time the update has been run after being installed. This is useful for determining whether you would like to show a "What's New?" UI to the end user after installing an update. _(Boolean)_
485
+ - **isMandatory**: Indicates whether the update is considered mandatory. This is the value that was specified in the CLI when the update was released. _(Boolean)_
486
+ - **isPending**: Indicates whether this update is in a "pending" state. When `true`, that means the update has been downloaded and installed, but the app restart needed to apply it hasn't occurred yet, and therefore, it's changes aren't currently visible to the end-user. _(Boolean)_
487
+ - **label**: The internal label automatically given to the update by the CodePush server, such as `v5`. This value uniquely identifies the update within its release channel. _(String)_
488
+ - **packageHash**: The SHA hash value of the update. _(String)_
489
+ - **packageSize**: The size of the code contained within the update, in bytes. _(Number)_
488
490
 
489
491
  ###### Methods
490
492
 
491
- - __install(installMode: codePush.InstallMode = codePush.InstallMode.ON_NEXT_RESTART, minimumBackgroundDuration = 0): Promise&lt;void&gt;__: Installs the update by saving it to the location on disk where the runtime expects to find the latest version of the app. The `installMode` parameter controls when the changes are actually presented to the end user. The default value is to wait until the next app restart to display the changes, but you can refer to the [`InstallMode`](#installmode) enum reference for a description of the available options and what they do. If the `installMode` parameter is set to `InstallMode.ON_NEXT_RESUME`, then the `minimumBackgroundDuration` parameter allows you to control how long the app must have been in the background before forcing the install after it is resumed.
493
+ - **install(installMode: codePush.InstallMode = codePush.InstallMode.ON_NEXT_RESTART, minimumBackgroundDuration = 0): Promise&lt;void&gt;**: Installs the update by saving it to the location on disk where the runtime expects to find the latest version of the app. The `installMode` parameter controls when the changes are actually presented to the end user. The default value is to wait until the next app restart to display the changes, but you can refer to the [`InstallMode`](#installmode) enum reference for a description of the available options and what they do. If the `installMode` parameter is set to `InstallMode.ON_NEXT_RESUME`, then the `minimumBackgroundDuration` parameter allows you to control how long the app must have been in the background before forcing the install after it is resumed.
492
494
 
493
495
  ##### RemotePackage
494
496
 
@@ -498,11 +500,11 @@ Contains details about an update that is available for download from the CodePus
498
500
 
499
501
  The `RemotePackage` inherits all of the same properties as the `LocalPackage`, but includes one additional one:
500
502
 
501
- - __downloadUrl__: The URL at which the package is available for download. This property is only needed for advanced usage, since the `download` method will automatically handle the acquisition of updates for you. *(String)*
503
+ - **downloadUrl**: The URL at which the package is available for download. This property is only needed for advanced usage, since the `download` method will automatically handle the acquisition of updates for you. _(String)_
502
504
 
503
505
  ###### Methods
504
506
 
505
- - __download(downloadProgressCallback?: Function): Promise&lt;LocalPackage&gt;__: Downloads the available update from the CodePush service. If a `downloadProgressCallback` is specified, it will be called periodically with a `DownloadProgress` object (`{ totalBytes: Number, receivedBytes: Number }`) that reports the progress of the download until it completes. Returns a Promise that resolves with the `LocalPackage`.
507
+ - **download(downloadProgressCallback?: Function): Promise&lt;LocalPackage&gt;**: Downloads the available update from the CodePush service. If a `downloadProgressCallback` is specified, it will be called periodically with a `DownloadProgress` object (`{ totalBytes: Number, receivedBytes: Number }`) that reports the progress of the download until it completes. Returns a Promise that resolves with the `LocalPackage`.
506
508
 
507
509
  #### Enums
508
510
 
@@ -512,44 +514,44 @@ The CodePush API includes the following enums which can be used to customize the
512
514
 
513
515
  This enum specifies when you would like an installed update to actually be applied, and can be passed to either the `sync` or `LocalPackage.install` methods. It includes the following values:
514
516
 
515
- * __codePush.InstallMode.IMMEDIATE__ *(0)* - Indicates that you want to install the update and restart the app immediately. 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.
517
+ - **codePush.InstallMode.IMMEDIATE** _(0)_ - Indicates that you want to install the update and restart the app immediately. 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.
516
518
 
517
- * __codePush.InstallMode.ON_NEXT_RESTART__ *(1)* - Indicates that you want to install the update, but not forcibly restart the app. 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.
519
+ - **codePush.InstallMode.ON_NEXT_RESTART** _(1)_ - Indicates that you want to install the update, but not forcibly restart the app. 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.
518
520
 
519
- * __codePush.InstallMode.ON_NEXT_RESUME__ *(2)* - 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. This way, you don't disrupt their current session, but you can get the update in front of them sooner then having to wait for the next natural restart. This value is appropriate for silent installs that can be applied on resume in a non-invasive way.
521
+ - **codePush.InstallMode.ON_NEXT_RESUME** _(2)_ - 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. This way, you don't disrupt their current session, but you can get the update in front of them sooner then having to wait for the next natural restart. This value is appropriate for silent installs that can be applied on resume in a non-invasive way.
520
522
 
521
- * __codePush.InstallMode.ON_NEXT_SUSPEND__ *(3)* - Indicates that you want to install the update _while_ it is in the background, but only after it has been in the background for `minimumBackgroundDuration` seconds (0 by default), so that user context isn't lost unless the app suspension is long enough to not matter.
523
+ - **codePush.InstallMode.ON_NEXT_SUSPEND** _(3)_ - Indicates that you want to install the update _while_ it is in the background, but only after it has been in the background for `minimumBackgroundDuration` seconds (0 by default), so that user context isn't lost unless the app suspension is long enough to not matter.
522
524
 
523
525
  ##### CheckFrequency
524
526
 
525
527
  This enum specifies when you would like your app to sync with the server for updates, and can be passed to the `codePushify` decorator. It includes the following values:
526
528
 
527
- * __codePush.CheckFrequency.ON_APP_START__ *(0)* - Indicates that you want to check for updates whenever the app's process is started.
529
+ - **codePush.CheckFrequency.ON_APP_START** _(0)_ - Indicates that you want to check for updates whenever the app's process is started.
528
530
 
529
- * __codePush.CheckFrequency.ON_APP_RESUME__ *(1)* - Indicates that you want to check for updates whenever the app is brought back to the foreground after being "backgrounded" (user pressed the home button, app launches a seperate payment process, etc).
531
+ - **codePush.CheckFrequency.ON_APP_RESUME** _(1)_ - Indicates that you want to check for updates whenever the app is brought back to the foreground after being "backgrounded" (user pressed the home button, app launches a seperate payment process, etc).
530
532
 
531
- * __codePush.CheckFrequency.MANUAL__ *(2)* - Disable automatic checking for updates, but only check when [`codePush.sync()`](#codepushsync) is called in app code.
533
+ - **codePush.CheckFrequency.MANUAL** _(2)_ - Disable automatic checking for updates, but only check when [`codePush.sync()`](#codepushsync) is called in app code.
532
534
 
533
535
  ##### SyncStatus
534
536
 
535
537
  This enum is provided to the `syncStatusChangedCallback` function that can be passed to the `sync` method, in order to hook into the overall update process. It includes the following values:
536
538
 
537
- * __codePush.SyncStatus.UP_TO_DATE__ *(0)* - The app is fully up-to-date with the configured release channel.
538
- * __codePush.SyncStatus.UPDATE_INSTALLED__ *(1)* - An available update has been installed and will be run either immediately after the `syncStatusChangedCallback` function returns or the next time the app resumes/restarts, depending on the `InstallMode` specified in `SyncOptions`.
539
- * __codePush.SyncStatus.UPDATE_IGNORED__ *(2)* - The app has an optional update, which the end user chose to ignore. (This is only applicable when the `updateDialog` is used)
540
- * __codePush.SyncStatus.UNKNOWN_ERROR__ *(3)* - The sync operation encountered an unknown error.
541
- * __codePush.SyncStatus.SYNC_IN_PROGRESS__ *(4)* - There is an ongoing `sync` operation running which prevents the current call from being executed.
542
- * __codePush.SyncStatus.CHECKING_FOR_UPDATE__ *(5)* - The CodePush server is being queried for an update.
543
- * __codePush.SyncStatus.AWAITING_USER_ACTION__ *(6)* - An update is available, and a confirmation dialog was shown to the end user. (This is only applicable when the `updateDialog` is used)
544
- * __codePush.SyncStatus.DOWNLOADING_PACKAGE__ *(7)* - An available update is being downloaded from the CodePush server.
545
- * __codePush.SyncStatus.INSTALLING_UPDATE__ *(8)* - An available update was downloaded and is about to be installed.
539
+ - **codePush.SyncStatus.UP_TO_DATE** _(0)_ - The app is fully up-to-date with the configured release channel.
540
+ - **codePush.SyncStatus.UPDATE_INSTALLED** _(1)_ - An available update has been installed and will be run either immediately after the `syncStatusChangedCallback` function returns or the next time the app resumes/restarts, depending on the `InstallMode` specified in `SyncOptions`.
541
+ - **codePush.SyncStatus.UPDATE_IGNORED** _(2)_ - The app has an optional update, which the end user chose to ignore. (This is only applicable when the `updateDialog` is used)
542
+ - **codePush.SyncStatus.UNKNOWN_ERROR** _(3)_ - The sync operation encountered an unknown error.
543
+ - **codePush.SyncStatus.SYNC_IN_PROGRESS** _(4)_ - There is an ongoing `sync` operation running which prevents the current call from being executed.
544
+ - **codePush.SyncStatus.CHECKING_FOR_UPDATE** _(5)_ - The CodePush server is being queried for an update.
545
+ - **codePush.SyncStatus.AWAITING_USER_ACTION** _(6)_ - An update is available, and a confirmation dialog was shown to the end user. (This is only applicable when the `updateDialog` is used)
546
+ - **codePush.SyncStatus.DOWNLOADING_PACKAGE** _(7)_ - An available update is being downloaded from the CodePush server.
547
+ - **codePush.SyncStatus.INSTALLING_UPDATE** _(8)_ - An available update was downloaded and is about to be installed.
546
548
 
547
549
  ##### UpdateState
548
550
 
549
551
  This enum specifies the state that an update is currently in, and can be specified when calling the `getUpdateMetadata` method. It includes the following values:
550
552
 
551
- * __codePush.UpdateState.RUNNING__ *(0)* - Indicates that an update represents the version of the app that is currently running. 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.
553
+ - **codePush.UpdateState.RUNNING** _(0)_ - Indicates that an update represents the version of the app that is currently running. 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.
552
554
 
553
- * __codePush.UpdateState.PENDING__ *(1)* - Indicates than an update has been installed, but the app hasn't been restarted yet in order to apply it. 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.
555
+ - **codePush.UpdateState.PENDING** _(1)_ - Indicates than an update has been installed, but the app hasn't been restarted yet in order to apply it. 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.
554
556
 
555
- * __codePush.UpdateState.LATEST__ *(2)* - Indicates than an update represents the latest available release, and can be either currently running or pending.
557
+ - **codePush.UpdateState.LATEST** _(2)_ - Indicates than an update represents the latest available release, and can be either currently running or pending.