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

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 (223) hide show
  1. package/README.md +7 -7
  2. package/android/app/src/main/java/com/appzung/codepush/react/CodePush.java +3 -0
  3. package/docs/advanced-usage.md +15 -0
  4. package/docs/api-js/README.md +5 -2
  5. package/docs/api-js/enumerations/CheckFrequency.md +1 -1
  6. package/docs/api-js/enumerations/DeploymentStatus.md +1 -1
  7. package/docs/api-js/enumerations/InstallMode.md +1 -1
  8. package/docs/api-js/enumerations/LogLevel.md +31 -0
  9. package/docs/api-js/enumerations/SyncStatus.md +1 -1
  10. package/docs/api-js/enumerations/UpdateState.md +1 -1
  11. package/docs/api-js/functions/allowRestart.md +1 -1
  12. package/docs/api-js/functions/checkForUpdate.md +1 -1
  13. package/docs/api-js/functions/clearUpdates.md +1 -1
  14. package/docs/api-js/functions/disallowRestart.md +1 -1
  15. package/docs/api-js/functions/getClientUniqueId.md +1 -1
  16. package/docs/api-js/functions/getLogLevel.md +13 -0
  17. package/docs/api-js/functions/getUpdateMetadata.md +1 -1
  18. package/docs/api-js/functions/notifyAppReady.md +1 -1
  19. package/docs/api-js/functions/resetClientUniqueId.md +1 -1
  20. package/docs/api-js/functions/restartApp.md +1 -1
  21. package/docs/api-js/functions/setLogLevel.md +19 -0
  22. package/docs/api-js/functions/sync.md +1 -1
  23. package/docs/api-js/functions/withCodePush.md +1 -1
  24. package/docs/api-js/interfaces/CodePushOptions.md +1 -1
  25. package/docs/api-js/interfaces/DownloadProgress.md +1 -1
  26. package/docs/api-js/interfaces/LocalPackage.md +1 -1
  27. package/docs/api-js/interfaces/Package.md +1 -1
  28. package/docs/api-js/interfaces/RemotePackage.md +1 -1
  29. package/docs/api-js/interfaces/RollbackRetryOptions.md +1 -1
  30. package/docs/api-js/interfaces/StatusReport.md +1 -1
  31. package/docs/api-js/interfaces/SyncOptions.md +1 -1
  32. package/docs/api-js/interfaces/UpdateDialog.md +1 -1
  33. package/docs/api-js/type-aliases/DownloadProgressCallback.md +1 -1
  34. package/docs/api-js/type-aliases/HandleBinaryVersionMismatchCallback.md +4 -2
  35. package/docs/api-js/type-aliases/SyncStatusChangedCallback.md +1 -1
  36. package/docs/api-js/variables/DEFAULT_UPDATE_DIALOG.md +1 -1
  37. package/docs/code-signing.md +2 -0
  38. package/docs/setup-android.md +0 -1
  39. package/ios/CodePush/CodePushConfig.m +4 -0
  40. package/lib/commonjs/CodePush.js +5 -0
  41. package/lib/commonjs/CodePush.js.map +1 -1
  42. package/lib/commonjs/checkForUpdates.js +25 -26
  43. package/lib/commonjs/checkForUpdates.js.map +1 -1
  44. package/lib/commonjs/enums/LogLevel.enum.js +14 -0
  45. package/lib/commonjs/enums/LogLevel.enum.js.map +1 -0
  46. package/lib/commonjs/index.js +30 -9
  47. package/lib/commonjs/index.js.map +1 -1
  48. package/lib/commonjs/internals/CodePushApiSdk.errors.js +26 -0
  49. package/lib/commonjs/internals/CodePushApiSdk.errors.js.map +1 -0
  50. package/lib/commonjs/internals/CodePushApiSdk.js +100 -0
  51. package/lib/commonjs/internals/CodePushApiSdk.js.map +1 -0
  52. package/lib/commonjs/{enums/DeploymentStatus.enum.js → internals/CodePushApiSdk.types.js} +3 -2
  53. package/lib/commonjs/internals/CodePushApiSdk.types.js.map +1 -0
  54. package/lib/commonjs/internals/RemotePackageImplementation.js +7 -5
  55. package/lib/commonjs/internals/RemotePackageImplementation.js.map +1 -1
  56. package/lib/commonjs/internals/shouldUpdateBeIgnored.js +6 -5
  57. package/lib/commonjs/internals/shouldUpdateBeIgnored.js.map +1 -1
  58. package/lib/commonjs/internals/utils/fetchRetry.js +59 -0
  59. package/lib/commonjs/internals/utils/fetchRetry.js.map +1 -0
  60. package/lib/commonjs/internals/utils/log.js +6 -1
  61. package/lib/commonjs/internals/utils/log.js.map +1 -1
  62. package/lib/commonjs/internals/utils/queryStringify.js +25 -0
  63. package/lib/commonjs/internals/utils/queryStringify.js.map +1 -0
  64. package/lib/commonjs/internals/utils/requestFetchAdapter.js +38 -0
  65. package/lib/commonjs/internals/utils/requestFetchAdapter.js.map +1 -0
  66. package/lib/commonjs/internals/version.js +1 -1
  67. package/lib/commonjs/logLevel.js +15 -0
  68. package/lib/commonjs/logLevel.js.map +1 -0
  69. package/lib/commonjs/notifyAppReady.js +22 -15
  70. package/lib/commonjs/notifyAppReady.js.map +1 -1
  71. package/lib/commonjs/sync.js +27 -24
  72. package/lib/commonjs/sync.js.map +1 -1
  73. package/lib/module/CodePush.js +5 -0
  74. package/lib/module/CodePush.js.map +1 -1
  75. package/lib/module/checkForUpdates.js +25 -26
  76. package/lib/module/checkForUpdates.js.map +1 -1
  77. package/lib/module/enums/LogLevel.enum.js +10 -0
  78. package/lib/module/enums/LogLevel.enum.js.map +1 -0
  79. package/lib/module/index.js +3 -1
  80. package/lib/module/index.js.map +1 -1
  81. package/lib/module/internals/CodePushApiSdk.errors.js +20 -0
  82. package/lib/module/internals/CodePushApiSdk.errors.js.map +1 -0
  83. package/lib/module/internals/CodePushApiSdk.js +96 -0
  84. package/lib/module/internals/CodePushApiSdk.js.map +1 -0
  85. package/lib/module/{enums/DeploymentStatus.enum.js → internals/CodePushApiSdk.types.js} +2 -1
  86. package/lib/module/internals/CodePushApiSdk.types.js.map +1 -0
  87. package/lib/module/internals/RemotePackageImplementation.js +7 -5
  88. package/lib/module/internals/RemotePackageImplementation.js.map +1 -1
  89. package/lib/module/internals/shouldUpdateBeIgnored.js +6 -5
  90. package/lib/module/internals/shouldUpdateBeIgnored.js.map +1 -1
  91. package/lib/module/internals/utils/fetchRetry.js +55 -0
  92. package/lib/module/internals/utils/fetchRetry.js.map +1 -0
  93. package/lib/module/internals/utils/log.js +7 -1
  94. package/lib/module/internals/utils/log.js.map +1 -1
  95. package/lib/module/internals/utils/queryStringify.js +21 -0
  96. package/lib/module/internals/utils/queryStringify.js.map +1 -0
  97. package/lib/module/internals/utils/requestFetchAdapter.js +34 -0
  98. package/lib/module/internals/utils/requestFetchAdapter.js.map +1 -0
  99. package/lib/module/internals/version.js +1 -1
  100. package/lib/module/logLevel.js +9 -0
  101. package/lib/module/logLevel.js.map +1 -0
  102. package/lib/module/notifyAppReady.js +22 -15
  103. package/lib/module/notifyAppReady.js.map +1 -1
  104. package/lib/module/sync.js +27 -24
  105. package/lib/module/sync.js.map +1 -1
  106. package/lib/typescript/commonjs/src/CodePush.d.ts.map +1 -1
  107. package/lib/typescript/commonjs/src/checkForUpdates.d.ts.map +1 -1
  108. package/lib/typescript/commonjs/src/enums/LogLevel.enum.d.ts +7 -0
  109. package/lib/typescript/commonjs/src/enums/LogLevel.enum.d.ts.map +1 -0
  110. package/lib/typescript/commonjs/src/index.d.ts +3 -1
  111. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  112. package/lib/typescript/commonjs/src/internals/CodePushApiSdk.d.ts +13 -0
  113. package/lib/typescript/commonjs/src/internals/CodePushApiSdk.d.ts.map +1 -0
  114. package/lib/typescript/commonjs/src/internals/CodePushApiSdk.errors.d.ts +9 -0
  115. package/lib/typescript/commonjs/src/internals/CodePushApiSdk.errors.d.ts.map +1 -0
  116. package/lib/typescript/commonjs/src/internals/CodePushApiSdk.types.d.ts +101 -0
  117. package/lib/typescript/commonjs/src/internals/CodePushApiSdk.types.d.ts.map +1 -0
  118. package/lib/typescript/commonjs/src/internals/RemotePackageImplementation.d.ts +2 -2
  119. package/lib/typescript/commonjs/src/internals/RemotePackageImplementation.d.ts.map +1 -1
  120. package/lib/typescript/commonjs/src/internals/shouldUpdateBeIgnored.d.ts.map +1 -1
  121. package/lib/typescript/commonjs/src/internals/types.d.ts +2 -2
  122. package/lib/typescript/commonjs/src/internals/types.d.ts.map +1 -1
  123. package/lib/typescript/commonjs/src/internals/utils/fetchRetry.d.ts +9 -0
  124. package/lib/typescript/commonjs/src/internals/utils/fetchRetry.d.ts.map +1 -0
  125. package/lib/typescript/commonjs/src/internals/utils/log.d.ts +2 -1
  126. package/lib/typescript/commonjs/src/internals/utils/log.d.ts.map +1 -1
  127. package/lib/typescript/commonjs/src/internals/utils/queryStringify.d.ts +4 -0
  128. package/lib/typescript/commonjs/src/internals/utils/queryStringify.d.ts.map +1 -0
  129. package/lib/typescript/commonjs/src/internals/utils/requestFetchAdapter.d.ts +3 -0
  130. package/lib/typescript/commonjs/src/internals/utils/requestFetchAdapter.d.ts.map +1 -0
  131. package/lib/typescript/commonjs/src/internals/version.d.ts +1 -1
  132. package/lib/typescript/commonjs/src/logLevel.d.ts +4 -0
  133. package/lib/typescript/commonjs/src/logLevel.d.ts.map +1 -0
  134. package/lib/typescript/commonjs/src/notifyAppReady.d.ts.map +1 -1
  135. package/lib/typescript/commonjs/src/sync.d.ts.map +1 -1
  136. package/lib/typescript/commonjs/src/types.d.ts +4 -3
  137. package/lib/typescript/commonjs/src/types.d.ts.map +1 -1
  138. package/lib/typescript/module/src/CodePush.d.ts.map +1 -1
  139. package/lib/typescript/module/src/checkForUpdates.d.ts.map +1 -1
  140. package/lib/typescript/module/src/enums/LogLevel.enum.d.ts +7 -0
  141. package/lib/typescript/module/src/enums/LogLevel.enum.d.ts.map +1 -0
  142. package/lib/typescript/module/src/index.d.ts +3 -1
  143. package/lib/typescript/module/src/index.d.ts.map +1 -1
  144. package/lib/typescript/module/src/internals/CodePushApiSdk.d.ts +13 -0
  145. package/lib/typescript/module/src/internals/CodePushApiSdk.d.ts.map +1 -0
  146. package/lib/typescript/module/src/internals/CodePushApiSdk.errors.d.ts +9 -0
  147. package/lib/typescript/module/src/internals/CodePushApiSdk.errors.d.ts.map +1 -0
  148. package/lib/typescript/module/src/internals/CodePushApiSdk.types.d.ts +101 -0
  149. package/lib/typescript/module/src/internals/CodePushApiSdk.types.d.ts.map +1 -0
  150. package/lib/typescript/module/src/internals/RemotePackageImplementation.d.ts +2 -2
  151. package/lib/typescript/module/src/internals/RemotePackageImplementation.d.ts.map +1 -1
  152. package/lib/typescript/module/src/internals/shouldUpdateBeIgnored.d.ts.map +1 -1
  153. package/lib/typescript/module/src/internals/types.d.ts +2 -2
  154. package/lib/typescript/module/src/internals/types.d.ts.map +1 -1
  155. package/lib/typescript/module/src/internals/utils/fetchRetry.d.ts +9 -0
  156. package/lib/typescript/module/src/internals/utils/fetchRetry.d.ts.map +1 -0
  157. package/lib/typescript/module/src/internals/utils/log.d.ts +2 -1
  158. package/lib/typescript/module/src/internals/utils/log.d.ts.map +1 -1
  159. package/lib/typescript/module/src/internals/utils/queryStringify.d.ts +4 -0
  160. package/lib/typescript/module/src/internals/utils/queryStringify.d.ts.map +1 -0
  161. package/lib/typescript/module/src/internals/utils/requestFetchAdapter.d.ts +3 -0
  162. package/lib/typescript/module/src/internals/utils/requestFetchAdapter.d.ts.map +1 -0
  163. package/lib/typescript/module/src/internals/version.d.ts +1 -1
  164. package/lib/typescript/module/src/logLevel.d.ts +4 -0
  165. package/lib/typescript/module/src/logLevel.d.ts.map +1 -0
  166. package/lib/typescript/module/src/notifyAppReady.d.ts.map +1 -1
  167. package/lib/typescript/module/src/sync.d.ts.map +1 -1
  168. package/lib/typescript/module/src/types.d.ts +4 -3
  169. package/lib/typescript/module/src/types.d.ts.map +1 -1
  170. package/package.json +3 -3
  171. package/src/CodePush.tsx +6 -0
  172. package/src/checkForUpdates.ts +26 -24
  173. package/src/enums/LogLevel.enum.ts +6 -0
  174. package/src/index.ts +3 -1
  175. package/src/internals/CodePushApiSdk.errors.ts +22 -0
  176. package/src/internals/CodePushApiSdk.ts +133 -0
  177. package/src/internals/CodePushApiSdk.types.ts +115 -0
  178. package/src/internals/RemotePackageImplementation.ts +9 -7
  179. package/src/internals/shouldUpdateBeIgnored.ts +6 -5
  180. package/src/internals/types.ts +2 -2
  181. package/src/internals/utils/fetchRetry.ts +72 -0
  182. package/src/internals/utils/log.ts +9 -1
  183. package/src/internals/utils/queryStringify.ts +22 -0
  184. package/src/internals/utils/requestFetchAdapter.ts +36 -0
  185. package/src/internals/version.ts +1 -1
  186. package/src/logLevel.ts +9 -0
  187. package/src/notifyAppReady.ts +25 -18
  188. package/src/sync.ts +33 -23
  189. package/src/types.ts +2 -3
  190. package/lib/commonjs/enums/DeploymentStatus.enum.js.map +0 -1
  191. package/lib/commonjs/internals/AcquisitionSdk.js +0 -9
  192. package/lib/commonjs/internals/AcquisitionSdk.js.map +0 -1
  193. package/lib/commonjs/internals/getPromisifiedSdk.js +0 -49
  194. package/lib/commonjs/internals/getPromisifiedSdk.js.map +0 -1
  195. package/lib/commonjs/internals/utils/request-fetch-adapter.js +0 -50
  196. package/lib/commonjs/internals/utils/request-fetch-adapter.js.map +0 -1
  197. package/lib/module/enums/DeploymentStatus.enum.js.map +0 -1
  198. package/lib/module/internals/AcquisitionSdk.js +0 -5
  199. package/lib/module/internals/AcquisitionSdk.js.map +0 -1
  200. package/lib/module/internals/getPromisifiedSdk.js +0 -45
  201. package/lib/module/internals/getPromisifiedSdk.js.map +0 -1
  202. package/lib/module/internals/utils/request-fetch-adapter.js +0 -46
  203. package/lib/module/internals/utils/request-fetch-adapter.js.map +0 -1
  204. package/lib/typescript/commonjs/src/enums/DeploymentStatus.enum.d.ts +0 -14
  205. package/lib/typescript/commonjs/src/enums/DeploymentStatus.enum.d.ts.map +0 -1
  206. package/lib/typescript/commonjs/src/internals/AcquisitionSdk.d.ts +0 -3
  207. package/lib/typescript/commonjs/src/internals/AcquisitionSdk.d.ts.map +0 -1
  208. package/lib/typescript/commonjs/src/internals/getPromisifiedSdk.d.ts +0 -13
  209. package/lib/typescript/commonjs/src/internals/getPromisifiedSdk.d.ts.map +0 -1
  210. package/lib/typescript/commonjs/src/internals/utils/request-fetch-adapter.d.ts +0 -3
  211. package/lib/typescript/commonjs/src/internals/utils/request-fetch-adapter.d.ts.map +0 -1
  212. package/lib/typescript/module/src/enums/DeploymentStatus.enum.d.ts +0 -14
  213. package/lib/typescript/module/src/enums/DeploymentStatus.enum.d.ts.map +0 -1
  214. package/lib/typescript/module/src/internals/AcquisitionSdk.d.ts +0 -3
  215. package/lib/typescript/module/src/internals/AcquisitionSdk.d.ts.map +0 -1
  216. package/lib/typescript/module/src/internals/getPromisifiedSdk.d.ts +0 -13
  217. package/lib/typescript/module/src/internals/getPromisifiedSdk.d.ts.map +0 -1
  218. package/lib/typescript/module/src/internals/utils/request-fetch-adapter.d.ts +0 -3
  219. package/lib/typescript/module/src/internals/utils/request-fetch-adapter.d.ts.map +0 -1
  220. package/src/enums/DeploymentStatus.enum.ts +0 -14
  221. package/src/internals/AcquisitionSdk.ts +0 -3
  222. package/src/internals/getPromisifiedSdk.ts +0 -72
  223. 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
 
@@ -145,11 +145,11 @@ withCodePush({ checkFrequency: CheckFrequency.ON_APP_RESUME })(MyApp);
145
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
  });
@@ -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;
@@ -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.
@@ -1,14 +1,15 @@
1
- **@appzung/react-native-code-push v11.0.0-rc3**
1
+ **@appzung/react-native-code-push v11.0.0-rc5**
2
2
 
3
3
  ---
4
4
 
5
- # @appzung/react-native-code-push v11.0.0-rc3
5
+ # @appzung/react-native-code-push v11.0.0-rc5
6
6
 
7
7
  ## Enumerations
8
8
 
9
9
  - [CheckFrequency](enumerations/CheckFrequency.md)
10
10
  - [DeploymentStatus](enumerations/DeploymentStatus.md)
11
11
  - [InstallMode](enumerations/InstallMode.md)
12
+ - [LogLevel](enumerations/LogLevel.md)
12
13
  - [SyncStatus](enumerations/SyncStatus.md)
13
14
  - [UpdateState](enumerations/UpdateState.md)
14
15
 
@@ -41,10 +42,12 @@
41
42
  - [clearUpdates](functions/clearUpdates.md)
42
43
  - [disallowRestart](functions/disallowRestart.md)
43
44
  - [getClientUniqueId](functions/getClientUniqueId.md)
45
+ - [getLogLevel](functions/getLogLevel.md)
44
46
  - [getUpdateMetadata](functions/getUpdateMetadata.md)
45
47
  - [notifyAppReady](functions/notifyAppReady.md)
46
48
  - [resetClientUniqueId](functions/resetClientUniqueId.md)
47
49
  - [restartApp](functions/restartApp.md)
50
+ - [setLogLevel](functions/setLogLevel.md)
48
51
  - [sync](functions/sync.md)
49
52
  - [withCodePush](functions/withCodePush.md)
50
53
 
@@ -1,4 +1,4 @@
1
- [**@appzung/react-native-code-push v11.0.0-rc3**](../README.md)
1
+ [**@appzung/react-native-code-push v11.0.0-rc5**](../README.md)
2
2
 
3
3
  ---
4
4
 
@@ -1,4 +1,4 @@
1
- [**@appzung/react-native-code-push v11.0.0-rc3**](../README.md)
1
+ [**@appzung/react-native-code-push v11.0.0-rc5**](../README.md)
2
2
 
3
3
  ---
4
4
 
@@ -1,4 +1,4 @@
1
- [**@appzung/react-native-code-push v11.0.0-rc3**](../README.md)
1
+ [**@appzung/react-native-code-push v11.0.0-rc5**](../README.md)
2
2
 
3
3
  ---
4
4
 
@@ -0,0 +1,31 @@
1
+ [**@appzung/react-native-code-push v11.0.0-rc5**](../README.md)
2
+
3
+ ---
4
+
5
+ [@appzung/react-native-code-push](../README.md) / LogLevel
6
+
7
+ # Enumeration: LogLevel
8
+
9
+ ## Enumeration Members
10
+
11
+ ### DEBUG
12
+
13
+ > **DEBUG**: `0`
14
+
15
+ ---
16
+
17
+ ### ERROR
18
+
19
+ > **ERROR**: `3`
20
+
21
+ ---
22
+
23
+ ### INFO
24
+
25
+ > **INFO**: `1`
26
+
27
+ ---
28
+
29
+ ### WARN
30
+
31
+ > **WARN**: `2`
@@ -1,4 +1,4 @@
1
- [**@appzung/react-native-code-push v11.0.0-rc3**](../README.md)
1
+ [**@appzung/react-native-code-push v11.0.0-rc5**](../README.md)
2
2
 
3
3
  ---
4
4
 
@@ -1,4 +1,4 @@
1
- [**@appzung/react-native-code-push v11.0.0-rc3**](../README.md)
1
+ [**@appzung/react-native-code-push v11.0.0-rc5**](../README.md)
2
2
 
3
3
  ---
4
4
 
@@ -1,4 +1,4 @@
1
- [**@appzung/react-native-code-push v11.0.0-rc3**](../README.md)
1
+ [**@appzung/react-native-code-push v11.0.0-rc5**](../README.md)
2
2
 
3
3
  ---
4
4
 
@@ -1,4 +1,4 @@
1
- [**@appzung/react-native-code-push v11.0.0-rc3**](../README.md)
1
+ [**@appzung/react-native-code-push v11.0.0-rc5**](../README.md)
2
2
 
3
3
  ---
4
4
 
@@ -1,4 +1,4 @@
1
- [**@appzung/react-native-code-push v11.0.0-rc3**](../README.md)
1
+ [**@appzung/react-native-code-push v11.0.0-rc5**](../README.md)
2
2
 
3
3
  ---
4
4
 
@@ -1,4 +1,4 @@
1
- [**@appzung/react-native-code-push v11.0.0-rc3**](../README.md)
1
+ [**@appzung/react-native-code-push v11.0.0-rc5**](../README.md)
2
2
 
3
3
  ---
4
4
 
@@ -1,4 +1,4 @@
1
- [**@appzung/react-native-code-push v11.0.0-rc3**](../README.md)
1
+ [**@appzung/react-native-code-push v11.0.0-rc5**](../README.md)
2
2
 
3
3
  ---
4
4
 
@@ -0,0 +1,13 @@
1
+ [**@appzung/react-native-code-push v11.0.0-rc5**](../README.md)
2
+
3
+ ---
4
+
5
+ [@appzung/react-native-code-push](../README.md) / getLogLevel
6
+
7
+ # Function: getLogLevel()
8
+
9
+ > **getLogLevel**(): [`LogLevel`](../enumerations/LogLevel.md)
10
+
11
+ ## Returns
12
+
13
+ [`LogLevel`](../enumerations/LogLevel.md)
@@ -1,4 +1,4 @@
1
- [**@appzung/react-native-code-push v11.0.0-rc3**](../README.md)
1
+ [**@appzung/react-native-code-push v11.0.0-rc5**](../README.md)
2
2
 
3
3
  ---
4
4
 
@@ -1,4 +1,4 @@
1
- [**@appzung/react-native-code-push v11.0.0-rc3**](../README.md)
1
+ [**@appzung/react-native-code-push v11.0.0-rc5**](../README.md)
2
2
 
3
3
  ---
4
4
 
@@ -1,4 +1,4 @@
1
- [**@appzung/react-native-code-push v11.0.0-rc3**](../README.md)
1
+ [**@appzung/react-native-code-push v11.0.0-rc5**](../README.md)
2
2
 
3
3
  ---
4
4
 
@@ -1,4 +1,4 @@
1
- [**@appzung/react-native-code-push v11.0.0-rc3**](../README.md)
1
+ [**@appzung/react-native-code-push v11.0.0-rc5**](../README.md)
2
2
 
3
3
  ---
4
4
 
@@ -0,0 +1,19 @@
1
+ [**@appzung/react-native-code-push v11.0.0-rc5**](../README.md)
2
+
3
+ ---
4
+
5
+ [@appzung/react-native-code-push](../README.md) / setLogLevel
6
+
7
+ # Function: setLogLevel()
8
+
9
+ > **setLogLevel**(`level`): `void`
10
+
11
+ ## Parameters
12
+
13
+ ### level
14
+
15
+ [`LogLevel`](../enumerations/LogLevel.md)
16
+
17
+ ## Returns
18
+
19
+ `void`
@@ -1,4 +1,4 @@
1
- [**@appzung/react-native-code-push v11.0.0-rc3**](../README.md)
1
+ [**@appzung/react-native-code-push v11.0.0-rc5**](../README.md)
2
2
 
3
3
  ---
4
4
 
@@ -1,4 +1,4 @@
1
- [**@appzung/react-native-code-push v11.0.0-rc3**](../README.md)
1
+ [**@appzung/react-native-code-push v11.0.0-rc5**](../README.md)
2
2
 
3
3
  ---
4
4
 
@@ -1,4 +1,4 @@
1
- [**@appzung/react-native-code-push v11.0.0-rc3**](../README.md)
1
+ [**@appzung/react-native-code-push v11.0.0-rc5**](../README.md)
2
2
 
3
3
  ---
4
4
 
@@ -1,4 +1,4 @@
1
- [**@appzung/react-native-code-push v11.0.0-rc3**](../README.md)
1
+ [**@appzung/react-native-code-push v11.0.0-rc5**](../README.md)
2
2
 
3
3
  ---
4
4
 
@@ -1,4 +1,4 @@
1
- [**@appzung/react-native-code-push v11.0.0-rc3**](../README.md)
1
+ [**@appzung/react-native-code-push v11.0.0-rc5**](../README.md)
2
2
 
3
3
  ---
4
4
 
@@ -1,4 +1,4 @@
1
- [**@appzung/react-native-code-push v11.0.0-rc3**](../README.md)
1
+ [**@appzung/react-native-code-push v11.0.0-rc5**](../README.md)
2
2
 
3
3
  ---
4
4
 
@@ -1,4 +1,4 @@
1
- [**@appzung/react-native-code-push v11.0.0-rc3**](../README.md)
1
+ [**@appzung/react-native-code-push v11.0.0-rc5**](../README.md)
2
2
 
3
3
  ---
4
4
 
@@ -1,4 +1,4 @@
1
- [**@appzung/react-native-code-push v11.0.0-rc3**](../README.md)
1
+ [**@appzung/react-native-code-push v11.0.0-rc5**](../README.md)
2
2
 
3
3
  ---
4
4
 
@@ -1,4 +1,4 @@
1
- [**@appzung/react-native-code-push v11.0.0-rc3**](../README.md)
1
+ [**@appzung/react-native-code-push v11.0.0-rc5**](../README.md)
2
2
 
3
3
  ---
4
4
 
@@ -1,4 +1,4 @@
1
- [**@appzung/react-native-code-push v11.0.0-rc3**](../README.md)
1
+ [**@appzung/react-native-code-push v11.0.0-rc5**](../README.md)
2
2
 
3
3
  ---
4
4
 
@@ -1,4 +1,4 @@
1
- [**@appzung/react-native-code-push v11.0.0-rc3**](../README.md)
1
+ [**@appzung/react-native-code-push v11.0.0-rc5**](../README.md)
2
2
 
3
3
  ---
4
4
 
@@ -1,4 +1,4 @@
1
- [**@appzung/react-native-code-push v11.0.0-rc3**](../README.md)
1
+ [**@appzung/react-native-code-push v11.0.0-rc5**](../README.md)
2
2
 
3
3
  ---
4
4
 
@@ -1,4 +1,4 @@
1
- [**@appzung/react-native-code-push v11.0.0-rc3**](../README.md)
1
+ [**@appzung/react-native-code-push v11.0.0-rc5**](../README.md)
2
2
 
3
3
  ---
4
4
 
@@ -14,7 +14,9 @@ Called when there are any binary update available.
14
14
 
15
15
  ### update
16
16
 
17
- `NativeUpdateNotification`
17
+ #### appVersion
18
+
19
+ `string`
18
20
 
19
21
  ## Returns
20
22
 
@@ -1,4 +1,4 @@
1
- [**@appzung/react-native-code-push v11.0.0-rc3**](../README.md)
1
+ [**@appzung/react-native-code-push v11.0.0-rc5**](../README.md)
2
2
 
3
3
  ---
4
4
 
@@ -1,4 +1,4 @@
1
- [**@appzung/react-native-code-push v11.0.0-rc3**](../README.md)
1
+ [**@appzung/react-native-code-push v11.0.0-rc5**](../README.md)
2
2
 
3
3
  ---
4
4
 
@@ -23,6 +23,8 @@ Store the private key securely.
23
23
  In the `appzung releases deploy-react-native` command that you run during your release process, add the `--private-key-path` flag pointing to the private key path.
24
24
  You should see `Code signing: true` in the confirmation text in interactive mode.
25
25
 
26
+ After following the setup for your app below, if you previously sent a CodePush release without code-signing (the `--private-key-path` CLI flag), it is expected that when you check for updates CodePush doesn't present you this update, since it now expects a code signed release. Make sure when you test your integration that you sent a code-signed release.
27
+
26
28
  ### Setup Android
27
29
 
28
30
  Add the `CodePushSigningPublicKey` string resource in `/android/app/src/main/res/values/strings.xml`. It may look like this:
@@ -1,7 +1,6 @@
1
1
  ## Android Setup
2
2
 
3
3
  - [Plugin Installation and Configuration](#plugin-installation-and-configuration)
4
- - [Code Signing setup](#code-signing-setup)
5
4
 
6
5
  ### Plugin Installation and Configuration
7
6
 
@@ -35,6 +35,10 @@ static NSString * const PublicKeyKey = @"publicKey";
35
35
  NSString *buildVersion = [infoDictionary objectForKey:(NSString *)kCFBundleVersionKey];
36
36
  NSString *releaseChannelPublicId = [infoDictionary objectForKey:@"CodePushReleaseChannelPublicId"];
37
37
  NSString *serverURL = [infoDictionary objectForKey:@"CodePushServerURL"];
38
+ if (!serverURL) {
39
+ serverURL = [infoDictionary objectForKey:@"CodePushServerUrl"];
40
+ }
41
+
38
42
  NSString *publicKey = [infoDictionary objectForKey:@"CodePushSigningPublicKey"];
39
43
 
40
44
  NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
@@ -9,6 +9,8 @@ var _hoistNonReactStatics = _interopRequireDefault(require("hoist-non-react-stat
9
9
  var _react = _interopRequireDefault(require("react"));
10
10
  var _reactNative = require("react-native");
11
11
  var _CheckFrequencyEnum = require("./enums/CheckFrequency.enum.js");
12
+ var _LogLevelEnum = require("./enums/LogLevel.enum.js");
13
+ var _log = require("./internals/utils/log.js");
12
14
  var _notifyAppReady = require("./notifyAppReady.js");
13
15
  var _sync = require("./sync.js");
14
16
  var _jsxRuntime = require("react/jsx-runtime");
@@ -39,6 +41,7 @@ function withCodePush(optionsOrComponent) {
39
41
  this.rootComponentRef = /*#__PURE__*/_react.default.createRef();
40
42
  }
41
43
  componentDidMount() {
44
+ (0, _log.log)(_LogLevelEnum.LogLevel.DEBUG, `withCodePush ${JSON.stringify(options)}`);
42
45
  if (options.checkFrequency === _CheckFrequencyEnum.CheckFrequency.MANUAL) {
43
46
  (0, _notifyAppReady.notifyAppReady)();
44
47
  } else {
@@ -55,10 +58,12 @@ function withCodePush(optionsOrComponent) {
55
58
  if (rootComponentInstance && rootComponentInstance.codePushOnBinaryVersionMismatch) {
56
59
  handleBinaryVersionMismatchCallback = rootComponentInstance.codePushOnBinaryVersionMismatch.bind(rootComponentInstance);
57
60
  }
61
+ (0, _log.log)(_LogLevelEnum.LogLevel.DEBUG, `sync on mount`);
58
62
  (0, _sync.sync)(options, syncStatusCallback, downloadProgressCallback, handleBinaryVersionMismatchCallback);
59
63
  if (options.checkFrequency === _CheckFrequencyEnum.CheckFrequency.ON_APP_RESUME) {
60
64
  _reactNative.AppState.addEventListener('change', newState => {
61
65
  if (newState === 'active') {
66
+ (0, _log.log)(_LogLevelEnum.LogLevel.DEBUG, `sync on active appState`);
62
67
  (0, _sync.sync)(options, syncStatusCallback, downloadProgressCallback);
63
68
  }
64
69
  });
@@ -1 +1 @@
1
- {"version":3,"names":["_hoistNonReactStatics","_interopRequireDefault","require","_react","_reactNative","_CheckFrequencyEnum","_notifyAppReady","_sync","_jsxRuntime","e","__esModule","default","withCodePush","optionsOrComponent","options","WithCodePush","RootComponent","CodePushComponent","React","Component","constructor","props","rootComponentRef","createRef","componentDidMount","checkFrequency","CheckFrequency","MANUAL","notifyAppReady","rootComponentInstance","current","syncStatusCallback","codePushStatusDidChange","bind","downloadProgressCallback","codePushDownloadDidProgress","handleBinaryVersionMismatchCallback","codePushOnBinaryVersionMismatch","sync","ON_APP_RESUME","AppState","addEventListener","newState","render","prototype","ref","jsx","hoistStatics","_default","exports"],"sourceRoot":"../../src","sources":["CodePush.tsx"],"mappings":";;;;;;;AAAA,IAAAA,qBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,mBAAA,GAAAH,OAAA;AACA,IAAAI,eAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AAA8B,IAAAM,WAAA,GAAAN,OAAA;AAAA,SAAAD,uBAAAQ,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAiB9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKO,SAASG,YAAYA,CAAmBC,kBAA4D,EAAE;EAC3G,MAAMC,OAAwB,GAAG,OAAOD,kBAAkB,KAAK,UAAU,GAAG,CAAC,CAAC,GAAGA,kBAAkB;EAEnG,MAAME,YAAY,GAAIC,aAAqC,IAAK;IAC9D,MAAMC,iBAAiB,SAASC,cAAK,CAACC,SAAS,CAAI;MAGjDC,WAAWA,CAACC,KAAY,EAAE;QACxB,KAAK,CAACA,KAAK,CAAC;QACZ,IAAI,CAACC,gBAAgB,gBAAGJ,cAAK,CAACK,SAAS,CAAC,CAAC;MAC3C;MAEAC,iBAAiBA,CAAA,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E;UAC7D;UACAtB,KAAK,CAACwB,GAAG,GAAG,IAAI,CAACvB,gBAAgB;QACnC;QAEA,oBAAO,IAAAd,WAAA,CAAAsC,GAAA,EAAC9B,aAAa;UAAA,GAAKK;QAAK,CAAG,CAAC;MACrC;IACF;IAEA,OAAO,IAAA0B,6BAAY,EAAC9B,iBAAiB,EAAED,aAAa,CAAC;EACvD,CAAC;EAED,IAAI,OAAOH,kBAAkB,KAAK,UAAU,EAAE;IAC5C;IACA,OAAOE,YAAY,CAACF,kBAAkB,CAAC;EACzC,CAAC,MAAM;IACL,OAAOE,YAAY;EACrB;AACF;AAAC,IAAAiC,QAAA,GAAAC,OAAA,CAAAtC,OAAA,GAEcC,YAAY","ignoreList":[]}
1
+ {"version":3,"names":["_hoistNonReactStatics","_interopRequireDefault","require","_react","_reactNative","_CheckFrequencyEnum","_LogLevelEnum","_log","_notifyAppReady","_sync","_jsxRuntime","e","__esModule","default","withCodePush","optionsOrComponent","options","WithCodePush","RootComponent","CodePushComponent","React","Component","constructor","props","rootComponentRef","createRef","componentDidMount","log","LogLevel","DEBUG","JSON","stringify","checkFrequency","CheckFrequency","MANUAL","notifyAppReady","rootComponentInstance","current","syncStatusCallback","codePushStatusDidChange","bind","downloadProgressCallback","codePushDownloadDidProgress","handleBinaryVersionMismatchCallback","codePushOnBinaryVersionMismatch","sync","ON_APP_RESUME","AppState","addEventListener","newState","render","prototype","ref","jsx","hoistStatics","_default","exports"],"sourceRoot":"../../src","sources":["CodePush.tsx"],"mappings":";;;;;;;AAAA,IAAAA,qBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,mBAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,IAAA,GAAAL,OAAA;AACA,IAAAM,eAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAP,OAAA;AAA8B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,IAAAsC,QAAA,GAAAC,OAAA,CAAA3C,OAAA,GAEcC,YAAY","ignoreList":[]}
@@ -5,13 +5,14 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.checkForUpdate = checkForUpdate;
7
7
  var _reactNative = require("react-native");
8
+ var _LogLevelEnum = require("./enums/LogLevel.enum.js");
9
+ var _CodePushApiSdk = require("./internals/CodePushApiSdk.js");
8
10
  var _NativeRNAppZungCodePushModule = require("./internals/NativeRNAppZungCodePushModule.js");
9
11
  var _RemotePackageImplementation = require("./internals/RemotePackageImplementation.js");
10
12
  var _getConfiguration = require("./internals/getConfiguration.js");
11
13
  var _getCurrentPackage = require("./internals/getCurrentPackage.js");
12
- var _getPromisifiedSdk = require("./internals/getPromisifiedSdk.js");
13
14
  var _log = require("./internals/utils/log.js");
14
- var _requestFetchAdapter = require("./internals/utils/request-fetch-adapter.js");
15
+ var _requestFetchAdapter = require("./internals/utils/requestFetchAdapter.js");
15
16
  /**
16
17
  * Asks the CodePush service whether the configured app release channel has an update available.
17
18
  *
@@ -38,11 +39,9 @@ async function checkForUpdate(releaseChannelPublicId, handleBinaryVersionMismatc
38
39
  */
39
40
  const config = releaseChannelPublicId ? {
40
41
  ...nativeConfig,
41
- ...{
42
- releaseChannelPublicId
43
- }
42
+ releaseChannelPublicId
44
43
  } : nativeConfig;
45
- const sdk = (0, _getPromisifiedSdk.getPromisifiedSdk)(_requestFetchAdapter.requestFetchAdapter, config);
44
+ const sdk = new _CodePushApiSdk.CodePushApiSdk(_requestFetchAdapter.requestFetchAdapter, config);
46
45
  const localPackage = await (0, _getCurrentPackage.getCurrentPackage)();
47
46
 
48
47
  /*
@@ -53,17 +52,12 @@ async function checkForUpdate(releaseChannelPublicId, handleBinaryVersionMismatc
53
52
  * to send the app version to the server, since we are interested
54
53
  * in any updates for current binary version, regardless of hash.
55
54
  */
56
- let queryPackage;
57
- if (localPackage) {
58
- queryPackage = localPackage;
59
- } else {
60
- queryPackage = {
61
- appVersion: config.appVersion
62
- };
63
- if (_reactNative.Platform.OS === 'ios' && config.packageHash) {
64
- queryPackage.packageHash = config.packageHash;
65
- }
66
- }
55
+ const queryPackage = localPackage ?? {
56
+ appVersion: config.appVersion,
57
+ ...(_reactNative.Platform.OS === 'ios' && config.packageHash ? {
58
+ packageHash: config.packageHash
59
+ } : {})
60
+ };
67
61
  const update = await sdk.queryUpdateWithCurrentPackage(queryPackage);
68
62
 
69
63
  /*
@@ -87,19 +81,24 @@ async function checkForUpdate(releaseChannelPublicId, handleBinaryVersionMismatc
87
81
  if (!update) {
88
82
  return null;
89
83
  }
90
- if ('updateAppVersion' in update && update.updateAppVersion) {
91
- (0, _log.log)('An update is available but it is not targeting the binary version of your app.');
84
+ if ('updateAppVersion' in update) {
85
+ if (!update.updateAppVersion) {
86
+ throw new Error('updateAppVersion should never be false');
87
+ }
88
+ (0, _log.log)(_LogLevelEnum.LogLevel.INFO, 'An update is available but it is not targeting the binary version of your app.');
92
89
  handleBinaryVersionMismatchCallback?.(update);
93
90
  return null;
94
91
  }
95
- if (localPackage && 'packageHash' in update && update.packageHash === localPackage.packageHash || (!localPackage || '_isDebugOnly' in localPackage && localPackage._isDebugOnly) && 'packageHash' in update && config.packageHash === update.packageHash) {
92
+ if (localPackage && update.packageHash === localPackage.packageHash || (!localPackage || '_isDebugOnly' in localPackage && localPackage._isDebugOnly) && config.packageHash === update.packageHash) {
96
93
  return null;
97
94
  }
98
-
99
- // @ts-expect-error sdk typing is wrong
100
- const remotePackage = new _RemotePackageImplementation.RemotePackageImpl(update, sdk.reportStatusDownload);
101
- remotePackage.failedInstall = await _NativeRNAppZungCodePushModule.NativeRNAppZungCodePushModule.isFailedUpdate(remotePackage.packageHash);
102
- remotePackage.releaseChannelPublicId = releaseChannelPublicId || nativeConfig.releaseChannelPublicId;
103
- return remotePackage;
95
+ const remotePackageData = {
96
+ ...update,
97
+ releaseChannelPublicId: releaseChannelPublicId || nativeConfig.releaseChannelPublicId,
98
+ failedInstall: await _NativeRNAppZungCodePushModule.NativeRNAppZungCodePushModule.isFailedUpdate(update.packageHash),
99
+ isFirstRun: false,
100
+ isPending: false
101
+ };
102
+ return new _RemotePackageImplementation.RemotePackageImpl(remotePackageData, packageInfo => sdk.reportStatusDownload(packageInfo));
104
103
  }
105
104
  //# sourceMappingURL=checkForUpdates.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_NativeRNAppZungCodePushModule","_RemotePackageImplementation","_getConfiguration","_getCurrentPackage","_getPromisifiedSdk","_log","_requestFetchAdapter","checkForUpdate","releaseChannelPublicId","handleBinaryVersionMismatchCallback","nativeConfig","getConfiguration","config","sdk","getPromisifiedSdk","requestFetchAdapter","localPackage","getCurrentPackage","queryPackage","appVersion","Platform","OS","packageHash","update","queryUpdateWithCurrentPackage","updateAppVersion","log","_isDebugOnly","remotePackage","RemotePackageImpl","reportStatusDownload","failedInstall","NativeRNAppZungCodePushModule","isFailedUpdate"],"sourceRoot":"../../src","sources":["checkForUpdates.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,8BAAA,GAAAD,OAAA;AACA,IAAAE,4BAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AACA,IAAAI,kBAAA,GAAAJ,OAAA;AACA,IAAAK,kBAAA,GAAAL,OAAA;AAEA,IAAAM,IAAA,GAAAN,OAAA;AACA,IAAAO,oBAAA,GAAAP,OAAA;AAGA;AACA;AACA;AACA;AACA;AACA;AACO,eAAeQ,cAAcA,CAClCC,sBAA+B,EAC/BC,mCAAyE,EAC1C;EAC/B;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,MAAMC,YAAY,GAAG,MAAM,IAAAC,kCAAgB,EAAC,CAAC;EAC7C;AACF;AACA;AACA;AACA;AACA;AACA;EACE,MAAMC,MAAqB,GAAGJ,sBAAsB,GAChD;IAAE,GAAGE,YAAY;IAAE,GAAG;MAAEF;IAAuB;EAAE,CAAC,GAClDE,Y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7EF,aAAa,CAACG,aAAa,GAAG,MAAMC,4DAA6B,CAACC,cAAc,CAACL,aAAa,CAACN,WAAW,CAAC;EAC3GM,aAAa,CAACpB,sBAAsB,GAAGA,sBAAsB,IAAIE,YAAY,CAACF,sBAAsB;EACpG,OAAOoB,aAAa;AACtB","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","_LogLevelEnum","_CodePushApiSdk","_NativeRNAppZungCodePushModule","_RemotePackageImplementation","_getConfiguration","_getCurrentPackage","_log","_requestFetchAdapter","checkForUpdate","releaseChannelPublicId","handleBinaryVersionMismatchCallback","nativeConfig","getConfiguration","config","sdk","CodePushApiSdk","requestFetchAdapter","localPackage","getCurrentPackage","queryPackage","appVersion","Platform","OS","packageHash","update","queryUpdateWithCurrentPackage","updateAppVersion","Error","log","LogLevel","INFO","_isDebugOnly","remotePackageData","failedInstall","NativeRNAppZungCodePushModule","isFailedUpdate","isFirstRun","isPending","RemotePackageImpl","packageInfo","reportStatusDownload"],"sourceRoot":"../../src","sources":["checkForUpdates.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AAEA,IAAAG,8BAAA,GAAAH,OAAA;AACA,IAAAI,4BAAA,GAAAJ,OAAA;AACA,IAAAK,iBAAA,GAAAL,OAAA;AACA,IAAAM,kBAAA,GAAAN,OAAA;AAEA,IAAAO,IAAA,GAAAP,OAAA;AACA,IAAAQ,oBAAA,GAAAR,OAAA;AAGA;AACA;AACA;AACA;AACA;AACA;AACO,eAAeS,cAAcA,CAClCC,sBAA+B,EAC/BC,mCAAyE,EAC1C;EAC/B;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,MAAMC,YAAY,GAAG,MAAM,IAAAC,kCAAgB,EAAC,CAAC;EAC7C;AACF;AACA;AACA;AACA;AACA;AACA;EACE,MAAMC,MAAqB,GAAGJ,sBAAsB,GAAG;IAAE,GAA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IE,YAAY,CAACF,sBAAsB;IACrFwB,aAAa,EAAE,MAAMC,4DAA6B,CAACC,cAAc,CAACX,MAAM,CAACD,WAAW,CAAC;IACrFa,UAAU,EAAE,KAAK;IACjBC,SAAS,EAAE;EACb,CAAC;EAED,OAAO,IAAIC,8CAAiB,CAACN,iBAAiB,EAAGO,WAAW,IAAKzB,GAAG,CAAC0B,oBAAoB,CAACD,WAAW,CAAC,CAAC;AACzG","ignoreList":[]}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.LogLevel = void 0;
7
+ let LogLevel = exports.LogLevel = /*#__PURE__*/function (LogLevel) {
8
+ LogLevel[LogLevel["DEBUG"] = 0] = "DEBUG";
9
+ LogLevel[LogLevel["INFO"] = 1] = "INFO";
10
+ LogLevel[LogLevel["WARN"] = 2] = "WARN";
11
+ LogLevel[LogLevel["ERROR"] = 3] = "ERROR";
12
+ return LogLevel;
13
+ }({});
14
+ //# sourceMappingURL=LogLevel.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["LogLevel","exports"],"sourceRoot":"../../../src","sources":["enums/LogLevel.enum.ts"],"mappings":";;;;;;IAAYA,QAAQ,GAAAC,OAAA,CAAAD,QAAA,0BAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA","ignoreList":[]}