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

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/CodePush.podspec +3 -5
  2. package/README.md +1 -1
  3. package/android/app/src/main/java/com/appzung/codepush/react/CodePushConstants.java +2 -0
  4. package/android/app/src/main/java/com/appzung/codepush/react/CodePushNativeModule.java +62 -0
  5. package/ios/CodePush/CodePush.h +10 -6
  6. package/ios/CodePush/{CodePush.m → CodePush.mm} +126 -142
  7. package/ios/CodePush/CodePushConfig.m +50 -0
  8. package/ios/CodePush.xcodeproj/project.pbxproj +6 -6
  9. package/lib/commonjs/CodePush.js.map +1 -1
  10. package/lib/commonjs/allowRestart.js +4 -2
  11. package/lib/commonjs/allowRestart.js.map +1 -1
  12. package/lib/commonjs/checkForUpdates.js +1 -1
  13. package/lib/commonjs/checkForUpdates.js.map +1 -1
  14. package/lib/commonjs/clearUpdates.js +4 -2
  15. package/lib/commonjs/clearUpdates.js.map +1 -1
  16. package/lib/commonjs/dataTransmission.js +28 -0
  17. package/lib/commonjs/dataTransmission.js.map +1 -0
  18. package/lib/commonjs/disallowRestart.js +4 -2
  19. package/lib/commonjs/disallowRestart.js.map +1 -1
  20. package/lib/commonjs/enums/LogLevel.enum.js +3 -0
  21. package/lib/commonjs/enums/LogLevel.enum.js.map +1 -1
  22. package/lib/commonjs/index.js +36 -0
  23. package/lib/commonjs/index.js.map +1 -1
  24. package/lib/commonjs/internals/CodePushApiSdk.js +23 -1
  25. package/lib/commonjs/internals/CodePushApiSdk.js.map +1 -1
  26. package/lib/commonjs/internals/CodePushApiSdk.types.js.map +1 -1
  27. package/lib/commonjs/internals/CodePushEventEmitter.js +10 -0
  28. package/lib/commonjs/internals/CodePushEventEmitter.js.map +1 -0
  29. package/lib/commonjs/internals/RemotePackageImplementation.js +2 -3
  30. package/lib/commonjs/internals/RemotePackageImplementation.js.map +1 -1
  31. package/lib/commonjs/internals/logger.js +51 -0
  32. package/lib/commonjs/internals/logger.js.map +1 -0
  33. package/lib/commonjs/internals/utils/log.js +4 -2
  34. package/lib/commonjs/internals/utils/log.js.map +1 -1
  35. package/lib/commonjs/internals/version.js +1 -1
  36. package/lib/commonjs/logger.js +19 -0
  37. package/lib/commonjs/logger.js.map +1 -0
  38. package/lib/commonjs/notifyAppReady.js +4 -2
  39. package/lib/commonjs/notifyAppReady.js.map +1 -1
  40. package/lib/commonjs/restartApp.js +2 -2
  41. package/lib/commonjs/restartApp.js.map +1 -1
  42. package/lib/commonjs/sync.js +5 -3
  43. package/lib/commonjs/sync.js.map +1 -1
  44. package/lib/commonjs/telemetry.js +28 -0
  45. package/lib/commonjs/telemetry.js.map +1 -0
  46. package/lib/module/CodePush.js.map +1 -1
  47. package/lib/module/allowRestart.js +3 -1
  48. package/lib/module/allowRestart.js.map +1 -1
  49. package/lib/module/checkForUpdates.js +1 -1
  50. package/lib/module/checkForUpdates.js.map +1 -1
  51. package/lib/module/clearUpdates.js +3 -1
  52. package/lib/module/clearUpdates.js.map +1 -1
  53. package/lib/module/dataTransmission.js +24 -0
  54. package/lib/module/dataTransmission.js.map +1 -0
  55. package/lib/module/disallowRestart.js +3 -1
  56. package/lib/module/disallowRestart.js.map +1 -1
  57. package/lib/module/enums/LogLevel.enum.js +3 -0
  58. package/lib/module/enums/LogLevel.enum.js.map +1 -1
  59. package/lib/module/index.js +3 -0
  60. package/lib/module/index.js.map +1 -1
  61. package/lib/module/internals/CodePushApiSdk.js +23 -1
  62. package/lib/module/internals/CodePushApiSdk.js.map +1 -1
  63. package/lib/module/internals/CodePushApiSdk.types.js.map +1 -1
  64. package/lib/module/internals/CodePushEventEmitter.js +6 -0
  65. package/lib/module/internals/CodePushEventEmitter.js.map +1 -0
  66. package/lib/module/internals/RemotePackageImplementation.js +2 -3
  67. package/lib/module/internals/RemotePackageImplementation.js.map +1 -1
  68. package/lib/module/internals/logger.js +44 -0
  69. package/lib/module/internals/logger.js.map +1 -0
  70. package/lib/module/internals/utils/log.js +4 -2
  71. package/lib/module/internals/utils/log.js.map +1 -1
  72. package/lib/module/internals/version.js +1 -1
  73. package/lib/module/logger.js +4 -0
  74. package/lib/module/logger.js.map +1 -0
  75. package/lib/module/notifyAppReady.js +4 -2
  76. package/lib/module/notifyAppReady.js.map +1 -1
  77. package/lib/module/restartApp.js +2 -2
  78. package/lib/module/restartApp.js.map +1 -1
  79. package/lib/module/sync.js +5 -3
  80. package/lib/module/sync.js.map +1 -1
  81. package/lib/module/telemetry.js +24 -0
  82. package/lib/module/telemetry.js.map +1 -0
  83. package/lib/typescript/commonjs/src/CodePush.d.ts +2 -2
  84. package/lib/typescript/commonjs/src/CodePush.d.ts.map +1 -1
  85. package/lib/typescript/commonjs/src/allowRestart.d.ts +1 -1
  86. package/lib/typescript/commonjs/src/allowRestart.d.ts.map +1 -1
  87. package/lib/typescript/commonjs/src/clearUpdates.d.ts +1 -1
  88. package/lib/typescript/commonjs/src/clearUpdates.d.ts.map +1 -1
  89. package/lib/typescript/commonjs/src/dataTransmission.d.ts +13 -0
  90. package/lib/typescript/commonjs/src/dataTransmission.d.ts.map +1 -0
  91. package/lib/typescript/commonjs/src/disallowRestart.d.ts +1 -1
  92. package/lib/typescript/commonjs/src/disallowRestart.d.ts.map +1 -1
  93. package/lib/typescript/commonjs/src/enums/LogLevel.enum.d.ts +3 -0
  94. package/lib/typescript/commonjs/src/enums/LogLevel.enum.d.ts.map +1 -1
  95. package/lib/typescript/commonjs/src/index.d.ts +3 -0
  96. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  97. package/lib/typescript/commonjs/src/internals/CodePushApiSdk.d.ts +3 -1
  98. package/lib/typescript/commonjs/src/internals/CodePushApiSdk.d.ts.map +1 -1
  99. package/lib/typescript/commonjs/src/internals/CodePushApiSdk.types.d.ts +2 -0
  100. package/lib/typescript/commonjs/src/internals/CodePushApiSdk.types.d.ts.map +1 -1
  101. package/lib/typescript/commonjs/src/internals/CodePushEventEmitter.d.ts +3 -0
  102. package/lib/typescript/commonjs/src/internals/CodePushEventEmitter.d.ts.map +1 -0
  103. package/lib/typescript/commonjs/src/internals/RNAppZungCodePushModuleSpec.d.ts +4 -0
  104. package/lib/typescript/commonjs/src/internals/RNAppZungCodePushModuleSpec.d.ts.map +1 -1
  105. package/lib/typescript/commonjs/src/internals/RemotePackageImplementation.d.ts.map +1 -1
  106. package/lib/typescript/commonjs/src/internals/logger.d.ts +33 -0
  107. package/lib/typescript/commonjs/src/internals/logger.d.ts.map +1 -0
  108. package/lib/typescript/commonjs/src/internals/utils/log.d.ts.map +1 -1
  109. package/lib/typescript/commonjs/src/internals/version.d.ts +1 -1
  110. package/lib/typescript/commonjs/src/logLevel.d.ts.map +1 -1
  111. package/lib/typescript/commonjs/src/logger.d.ts +3 -0
  112. package/lib/typescript/commonjs/src/logger.d.ts.map +1 -0
  113. package/lib/typescript/commonjs/src/notifyAppReady.d.ts +2 -0
  114. package/lib/typescript/commonjs/src/notifyAppReady.d.ts.map +1 -1
  115. package/lib/typescript/commonjs/src/restartApp.d.ts.map +1 -1
  116. package/lib/typescript/commonjs/src/sync.d.ts +2 -0
  117. package/lib/typescript/commonjs/src/sync.d.ts.map +1 -1
  118. package/lib/typescript/commonjs/src/telemetry.d.ts +13 -0
  119. package/lib/typescript/commonjs/src/telemetry.d.ts.map +1 -0
  120. package/lib/typescript/module/src/CodePush.d.ts +2 -2
  121. package/lib/typescript/module/src/CodePush.d.ts.map +1 -1
  122. package/lib/typescript/module/src/allowRestart.d.ts +1 -1
  123. package/lib/typescript/module/src/allowRestart.d.ts.map +1 -1
  124. package/lib/typescript/module/src/clearUpdates.d.ts +1 -1
  125. package/lib/typescript/module/src/clearUpdates.d.ts.map +1 -1
  126. package/lib/typescript/module/src/dataTransmission.d.ts +13 -0
  127. package/lib/typescript/module/src/dataTransmission.d.ts.map +1 -0
  128. package/lib/typescript/module/src/disallowRestart.d.ts +1 -1
  129. package/lib/typescript/module/src/disallowRestart.d.ts.map +1 -1
  130. package/lib/typescript/module/src/enums/LogLevel.enum.d.ts +3 -0
  131. package/lib/typescript/module/src/enums/LogLevel.enum.d.ts.map +1 -1
  132. package/lib/typescript/module/src/index.d.ts +3 -0
  133. package/lib/typescript/module/src/index.d.ts.map +1 -1
  134. package/lib/typescript/module/src/internals/CodePushApiSdk.d.ts +3 -1
  135. package/lib/typescript/module/src/internals/CodePushApiSdk.d.ts.map +1 -1
  136. package/lib/typescript/module/src/internals/CodePushApiSdk.types.d.ts +2 -0
  137. package/lib/typescript/module/src/internals/CodePushApiSdk.types.d.ts.map +1 -1
  138. package/lib/typescript/module/src/internals/CodePushEventEmitter.d.ts +3 -0
  139. package/lib/typescript/module/src/internals/CodePushEventEmitter.d.ts.map +1 -0
  140. package/lib/typescript/module/src/internals/RNAppZungCodePushModuleSpec.d.ts +4 -0
  141. package/lib/typescript/module/src/internals/RNAppZungCodePushModuleSpec.d.ts.map +1 -1
  142. package/lib/typescript/module/src/internals/RemotePackageImplementation.d.ts.map +1 -1
  143. package/lib/typescript/module/src/internals/logger.d.ts +33 -0
  144. package/lib/typescript/module/src/internals/logger.d.ts.map +1 -0
  145. package/lib/typescript/module/src/internals/utils/log.d.ts.map +1 -1
  146. package/lib/typescript/module/src/internals/version.d.ts +1 -1
  147. package/lib/typescript/module/src/logLevel.d.ts.map +1 -1
  148. package/lib/typescript/module/src/logger.d.ts +3 -0
  149. package/lib/typescript/module/src/logger.d.ts.map +1 -0
  150. package/lib/typescript/module/src/notifyAppReady.d.ts +2 -0
  151. package/lib/typescript/module/src/notifyAppReady.d.ts.map +1 -1
  152. package/lib/typescript/module/src/restartApp.d.ts.map +1 -1
  153. package/lib/typescript/module/src/sync.d.ts +2 -0
  154. package/lib/typescript/module/src/sync.d.ts.map +1 -1
  155. package/lib/typescript/module/src/telemetry.d.ts +13 -0
  156. package/lib/typescript/module/src/telemetry.d.ts.map +1 -0
  157. package/package.json +23 -14
  158. package/scripts/generateBundledResourcesHash.js +73 -68
  159. package/scripts/getFilesInFolder.js +12 -12
  160. package/scripts/recordFilesBeforeBundleCommand.js +19 -20
  161. package/src/CodePush.tsx +4 -2
  162. package/src/allowRestart.ts +3 -1
  163. package/src/checkForUpdates.ts +1 -1
  164. package/src/clearUpdates.ts +3 -1
  165. package/src/dataTransmission.ts +21 -0
  166. package/src/disallowRestart.ts +3 -1
  167. package/src/enums/LogLevel.enum.ts +3 -0
  168. package/src/index.ts +3 -0
  169. package/src/internals/CodePushApiSdk.ts +27 -0
  170. package/src/internals/CodePushApiSdk.types.ts +2 -0
  171. package/src/internals/CodePushEventEmitter.ts +4 -0
  172. package/src/internals/RNAppZungCodePushModuleSpec.ts +6 -0
  173. package/src/internals/RemotePackageImplementation.ts +2 -3
  174. package/src/internals/logger.ts +46 -0
  175. package/src/internals/utils/log.ts +4 -2
  176. package/src/internals/version.ts +1 -1
  177. package/src/logger.ts +2 -0
  178. package/src/notifyAppReady.ts +4 -2
  179. package/src/restartApp.ts +2 -2
  180. package/src/sync.ts +5 -3
  181. package/src/telemetry.ts +21 -0
  182. package/docs/advanced-usage.md +0 -71
  183. package/docs/api-android.md +0 -22
  184. package/docs/api-ios.md +0 -19
  185. package/docs/api-js/README.md +0 -58
  186. package/docs/api-js/enumerations/CheckFrequency.md +0 -33
  187. package/docs/api-js/enumerations/DeploymentStatus.md +0 -25
  188. package/docs/api-js/enumerations/InstallMode.md +0 -50
  189. package/docs/api-js/enumerations/LogLevel.md +0 -31
  190. package/docs/api-js/enumerations/SyncStatus.md +0 -85
  191. package/docs/api-js/enumerations/UpdateState.md +0 -37
  192. package/docs/api-js/functions/allowRestart.md +0 -17
  193. package/docs/api-js/functions/checkForUpdate.md +0 -29
  194. package/docs/api-js/functions/clearUpdates.md +0 -19
  195. package/docs/api-js/functions/disallowRestart.md +0 -17
  196. package/docs/api-js/functions/getClientUniqueId.md +0 -15
  197. package/docs/api-js/functions/getLogLevel.md +0 -13
  198. package/docs/api-js/functions/getUpdateMetadata.md +0 -23
  199. package/docs/api-js/functions/notifyAppReady.md +0 -17
  200. package/docs/api-js/functions/resetClientUniqueId.md +0 -15
  201. package/docs/api-js/functions/restartApp.md +0 -25
  202. package/docs/api-js/functions/setLogLevel.md +0 -19
  203. package/docs/api-js/functions/sync.md +0 -43
  204. package/docs/api-js/functions/withCodePush.md +0 -65
  205. package/docs/api-js/interfaces/CodePushOptions.md +0 -118
  206. package/docs/api-js/interfaces/DownloadProgress.md +0 -23
  207. package/docs/api-js/interfaces/LocalPackage.md +0 -171
  208. package/docs/api-js/interfaces/Package.md +0 -98
  209. package/docs/api-js/interfaces/RemotePackage.md +0 -169
  210. package/docs/api-js/interfaces/RollbackRetryOptions.md +0 -28
  211. package/docs/api-js/interfaces/StatusReport.md +0 -47
  212. package/docs/api-js/interfaces/SyncOptions.md +0 -80
  213. package/docs/api-js/interfaces/UpdateDialog.md +0 -89
  214. package/docs/api-js/type-aliases/DownloadProgressCallback.md +0 -21
  215. package/docs/api-js/type-aliases/HandleBinaryVersionMismatchCallback.md +0 -23
  216. package/docs/api-js/type-aliases/SyncStatusChangedCallback.md +0 -23
  217. package/docs/api-js/variables/DEFAULT_UPDATE_DIALOG.md +0 -12
  218. package/docs/code-signing.md +0 -64
  219. package/docs/migrating-to-v10.md +0 -31
  220. package/docs/setup-android.md +0 -80
  221. package/docs/setup-ios.md +0 -108
  222. package/docs/setup-windows.md +0 -55
  223. package/typedoc.json +0 -9
package/CodePush.podspec CHANGED
@@ -14,14 +14,12 @@ Pod::Spec.new do |s|
14
14
  s.tvos.deployment_target = '15.5'
15
15
  s.preserve_paths = '*.js'
16
16
  s.library = 'z'
17
- s.source_files = 'ios/CodePush/*.{h,m}'
17
+ s.source_files = 'ios/CodePush/*.{h,m,mm}'
18
18
  s.public_header_files = ['ios/CodePush/CodePush.h']
19
19
  s.pod_target_xcconfig = { "DEFINES_MODULE" => "YES" }
20
20
 
21
- # Note: Even though there are copy/pasted versions of some of these dependencies in the repo,
22
- # we explicitly let CocoaPods pull in the versions below so all dependencies are resolved and
23
- # linked properly at a parent workspace level.
24
- s.dependency 'React-Core'
21
+ install_modules_dependencies(s)
22
+
25
23
  s.dependency 'SSZipArchive', '~> 2.5.5'
26
24
  s.dependency 'JWT', '~> 3.0.0-beta.12'
27
25
  s.dependency 'Base64', '~> 1.1'
package/README.md CHANGED
@@ -21,7 +21,7 @@
21
21
  [AppZung](https://appzung.com) is a robust solution for CodePush functionality, created in response to AppCenter's retirement.
22
22
  CodePush allows you to easily add a dynamic update experience to your React Native apps.
23
23
 
24
- We offer feature-parity with the original CodePush and will introduce advanced capabilities in:
24
+ We offer feature-parity with the original CodePush and introduce advanced capabilities in:
25
25
 
26
26
  - Hosting
27
27
  - Delivery
@@ -32,4 +32,6 @@ public class CodePushConstants {
32
32
  public static final String LATEST_ROLLBACK_TIME_KEY = "time";
33
33
  public static final String LATEST_ROLLBACK_COUNT_KEY = "count";
34
34
  public static final String CLIENT_UNIQUE_ID_KEY = "clientUniqueId";
35
+ public static final String TELEMETRY_ENABLED_KEY = "telemetryEnabled";
36
+ public static final String DATA_TRANSMISSION_ENABLED_KEY = "dataTransmissionEnabled";
35
37
  }
@@ -49,6 +49,8 @@ import java.util.UUID;
49
49
  public class CodePushNativeModule extends BaseJavaModule {
50
50
  private String mBinaryContentsHash = null;
51
51
  private String mClientUniqueId = null;
52
+ private boolean mTelemetryEnabled = true;
53
+ private boolean mDataTransmissionEnabled = true;
52
54
  private LifecycleEventListener mLifecycleEventListener = null;
53
55
  private int mMinimumBackgroundDuration = 0;
54
56
 
@@ -78,6 +80,28 @@ public class CodePushNativeModule extends BaseJavaModule {
78
80
  mClientUniqueId = UUID.randomUUID().toString();
79
81
  preferences.edit().putString(CodePushConstants.CLIENT_UNIQUE_ID_KEY, mClientUniqueId).apply();
80
82
  }
83
+
84
+ if (preferences.contains(CodePushConstants.TELEMETRY_ENABLED_KEY)) {
85
+ mTelemetryEnabled = preferences.getBoolean(CodePushConstants.TELEMETRY_ENABLED_KEY, true);
86
+ } else {
87
+ int defaultTelemetryEnabledResId = reactContext.getResources().getIdentifier("CodePushDefaultTelemetryEnabled", "bool", reactContext.getPackageName());
88
+ if (defaultTelemetryEnabledResId != 0) {
89
+ mTelemetryEnabled = reactContext.getResources().getBoolean(defaultTelemetryEnabledResId);
90
+ } else {
91
+ mTelemetryEnabled = true;
92
+ }
93
+ }
94
+
95
+ if (preferences.contains(CodePushConstants.DATA_TRANSMISSION_ENABLED_KEY)) {
96
+ mDataTransmissionEnabled = preferences.getBoolean(CodePushConstants.DATA_TRANSMISSION_ENABLED_KEY, true);
97
+ } else {
98
+ int defaultDataTransmissionEnabledResId = reactContext.getResources().getIdentifier("CodePushDefaultDataTransmissionEnabled", "bool", reactContext.getPackageName());
99
+ if (defaultDataTransmissionEnabledResId != 0) {
100
+ mDataTransmissionEnabled = reactContext.getResources().getBoolean(defaultDataTransmissionEnabledResId);
101
+ } else {
102
+ mDataTransmissionEnabled = true;
103
+ }
104
+ }
81
105
  }
82
106
 
83
107
  @Override
@@ -485,6 +509,8 @@ public class CodePushNativeModule extends BaseJavaModule {
485
509
  configMap.putString("clientUniqueId", mClientUniqueId);
486
510
  configMap.putString("releaseChannelPublicId", mCodePush.getReleaseChannelPublicId());
487
511
  configMap.putString("serverUrl", mCodePush.getServerUrl());
512
+ configMap.putBoolean("telemetryEnabled", mTelemetryEnabled);
513
+ configMap.putBoolean("dataTransmissionEnabled", mDataTransmissionEnabled);
488
514
 
489
515
  // The binary hash may be null in debug builds
490
516
  if (mBinaryContentsHash != null) {
@@ -834,6 +860,42 @@ public class CodePushNativeModule extends BaseJavaModule {
834
860
  }
835
861
  }
836
862
 
863
+ @ReactMethod
864
+ public void setTelemetryEnabled(boolean enabled, Promise promise) {
865
+ try {
866
+ SharedPreferences preferences = mCodePush.getContext().getSharedPreferences(CodePushConstants.CODE_PUSH_PREFERENCES, 0);
867
+ preferences.edit().putBoolean(CodePushConstants.TELEMETRY_ENABLED_KEY, enabled).apply();
868
+ mTelemetryEnabled = enabled;
869
+ promise.resolve(null);
870
+ } catch (Exception e) {
871
+ CodePushUtils.log(e);
872
+ promise.reject(e);
873
+ }
874
+ }
875
+
876
+ @ReactMethod
877
+ public void getTelemetryEnabled(Promise promise) {
878
+ promise.resolve(mTelemetryEnabled);
879
+ }
880
+
881
+ @ReactMethod
882
+ public void setDataTransmissionEnabled(boolean enabled, Promise promise) {
883
+ try {
884
+ SharedPreferences preferences = mCodePush.getContext().getSharedPreferences(CodePushConstants.CODE_PUSH_PREFERENCES, 0);
885
+ preferences.edit().putBoolean(CodePushConstants.DATA_TRANSMISSION_ENABLED_KEY, enabled).apply();
886
+ mDataTransmissionEnabled = enabled;
887
+ promise.resolve(null);
888
+ } catch (Exception e) {
889
+ CodePushUtils.log(e);
890
+ promise.reject(e);
891
+ }
892
+ }
893
+
894
+ @ReactMethod
895
+ public void getDataTransmissionEnabled(Promise promise) {
896
+ promise.resolve(mDataTransmissionEnabled);
897
+ }
898
+
837
899
  @ReactMethod
838
900
  public void addListener(String eventName) {
839
901
  // Set up any upstream listeners or background tasks as necessary
@@ -63,12 +63,6 @@
63
63
  + (BOOL)isFailedHash:(NSString*)packageHash;
64
64
 
65
65
 
66
- /*
67
- * This method is used to get information about the latest rollback.
68
- * This information will be used to decide whether the application
69
- * should ignore the update or not.
70
- */
71
- + (NSDictionary*)getRollbackInfo;
72
66
  /*
73
67
  * This method is used to save information about the latest rollback.
74
68
  * This information will be used to decide whether the application
@@ -104,6 +98,8 @@
104
98
  @property (readonly) NSString *clientUniqueId;
105
99
  @property (copy) NSString *serverURL;
106
100
  @property (copy) NSString *publicKey;
101
+ @property (nonatomic) BOOL telemetryEnabled;
102
+ @property (nonatomic) BOOL dataTransmissionEnabled;
107
103
 
108
104
  + (instancetype)current;
109
105
 
@@ -220,8 +216,16 @@ failCallback:(void (^)(NSError *err))failCallback;
220
216
 
221
217
  @end
222
218
 
219
+ #ifdef __cplusplus
220
+ extern "C" {
221
+ #endif
222
+
223
223
  void CPLog(NSString *formatString, ...);
224
224
 
225
+ #ifdef __cplusplus
226
+ }
227
+ #endif
228
+
225
229
  typedef NS_ENUM(NSInteger, CodePushInstallMode) {
226
230
  CodePushInstallModeImmediate,
227
231
  CodePushInstallModeOnNextRestart,
@@ -1,4 +1,3 @@
1
- #if __has_include(<React/RCTAssert.h>)
2
1
  #import <React/RCTAssert.h>
3
2
  #import <React/RCTBridgeModule.h>
4
3
  #import <React/RCTConvert.h>
@@ -6,18 +5,10 @@
6
5
  #import <React/RCTRootView.h>
7
6
  #import <React/RCTUtils.h>
8
7
  #import <React/RCTReloadCommand.h>
9
- #else // back compatibility for RN version < 0.40
10
- #import "RCTAssert.h"
11
- #import "RCTBridgeModule.h"
12
- #import "RCTConvert.h"
13
- #import "RCTEventDispatcher.h"
14
- #import "RCTRootView.h"
15
- #import "RCTUtils.h"
16
- #endif
17
8
 
18
9
  #import "CodePush.h"
19
10
 
20
- @interface CodePush () <RCTBridgeModule, RCTFrameUpdateObserver>
11
+ @interface CodePush () <RCTBridgeModule>
21
12
  @end
22
13
 
23
14
  @implementation CodePush {
@@ -30,8 +21,8 @@
30
21
 
31
22
  // Used to coordinate the dispatching of download progress events to JS.
32
23
  long long _latestExpectedContentLength;
33
- long long _latestReceivedConentLength;
34
- BOOL _didUpdateProgress;
24
+ long long _latestReceivedContentLength;
25
+ NSTimeInterval _lastProgressEmitTimestamp;
35
26
 
36
27
  BOOL _allowed;
37
28
  BOOL _restartInProgress;
@@ -255,18 +246,6 @@ static NSString *const LatestRollbackCountKey = @"count";
255
246
  #pragma mark - Private API methods
256
247
 
257
248
  @synthesize methodQueue = _methodQueue;
258
- @synthesize pauseCallback = _pauseCallback;
259
- @synthesize paused = _paused;
260
-
261
- - (void)setPaused:(BOOL)paused
262
- {
263
- if (_paused != paused) {
264
- _paused = paused;
265
- if (_pauseCallback) {
266
- _pauseCallback();
267
- }
268
- }
269
- }
270
249
 
271
250
  /*
272
251
  * This method is used to clear updates that are installed
@@ -302,15 +281,15 @@ static NSString *const LatestRollbackCountKey = @"count";
302
281
  // Export the values of the CodePushInstallMode and CodePushUpdateState
303
282
  // enums so that the script-side can easily stay in sync
304
283
  return @{
305
- @"codePushInstallModeOnNextRestart":@(CodePushInstallModeOnNextRestart),
306
- @"codePushInstallModeImmediate": @(CodePushInstallModeImmediate),
307
- @"codePushInstallModeOnNextResume": @(CodePushInstallModeOnNextResume),
308
- @"codePushInstallModeOnNextSuspend": @(CodePushInstallModeOnNextSuspend),
309
-
310
- @"codePushUpdateStateRunning": @(CodePushUpdateStateRunning),
311
- @"codePushUpdateStatePending": @(CodePushUpdateStatePending),
312
- @"codePushUpdateStateLatest": @(CodePushUpdateStateLatest)
313
- };
284
+ @"codePushInstallModeOnNextRestart":@(CodePushInstallModeOnNextRestart),
285
+ @"codePushInstallModeImmediate": @(CodePushInstallModeImmediate),
286
+ @"codePushInstallModeOnNextResume": @(CodePushInstallModeOnNextResume),
287
+ @"codePushInstallModeOnNextSuspend": @(CodePushInstallModeOnNextSuspend),
288
+
289
+ @"codePushUpdateStateRunning": @(CodePushUpdateStateRunning),
290
+ @"codePushUpdateStatePending": @(CodePushUpdateStatePending),
291
+ @"codePushUpdateStateLatest": @(CodePushUpdateStateLatest)
292
+ };
314
293
  };
315
294
 
316
295
  + (BOOL)requiresMainQueueSetup
@@ -326,14 +305,14 @@ static NSString *const LatestRollbackCountKey = @"count";
326
305
  }
327
306
 
328
307
  - (void)dispatchDownloadProgressEvent {
329
- // Notify the script-side about the progress
330
- [self sendEventWithName:DownloadProgressEvent
331
- body:@{
332
- @"totalBytes" : [NSNumber
333
- numberWithLongLong:_latestExpectedContentLength],
334
- @"receivedBytes" : [NSNumber
335
- numberWithLongLong:_latestReceivedConentLength]
336
- }];
308
+ // Notify the script-side about the progress
309
+ [self sendEventWithName:DownloadProgressEvent
310
+ body:@{
311
+ @"totalBytes" : [NSNumber
312
+ numberWithLongLong:_latestExpectedContentLength],
313
+ @"receivedBytes" : [NSNumber
314
+ numberWithLongLong:_latestReceivedContentLength]
315
+ }];
337
316
  }
338
317
 
339
318
  /*
@@ -345,28 +324,28 @@ static NSString *const LatestRollbackCountKey = @"count";
345
324
  if (![self binaryBundleURL]) {
346
325
  NSString *errorMessage;
347
326
 
348
- #ifdef DEBUG
349
- #if TARGET_IPHONE_SIMULATOR
350
- errorMessage = @"React Native doesn't generate your app's JS bundle by default when deploying to the simulator. "
351
- "If you'd like to test CodePush using the simulator, you can do one of the following depending on your "
352
- "React Native version and/or preferred workflow:\n\n"
327
+ #ifdef DEBUG
328
+ #if TARGET_IPHONE_SIMULATOR
329
+ errorMessage = @"React Native doesn't generate your app's JS bundle by default when deploying to the simulator. "
330
+ "If you'd like to test CodePush using the simulator, you can do one of the following depending on your "
331
+ "React Native version and/or preferred workflow:\n\n"
353
332
 
354
- "1. Update your AppDelegate.m file to load the JS bundle from the packager instead of from CodePush. "
355
- "You can still test your CodePush update experience using this workflow (Debug builds only).\n\n"
333
+ "1. Update your AppDelegate.m file to load the JS bundle from the packager instead of from CodePush. "
334
+ "You can still test your CodePush update experience using this workflow (Debug builds only).\n\n"
356
335
 
357
- "2. Force the JS bundle to be generated in simulator builds by adding 'export FORCE_BUNDLING=true' to the script under "
358
- "\"Build Phases\" > \"Bundle React Native code and images\" (React Native >=0.48 only).\n\n"
336
+ "2. Force the JS bundle to be generated in simulator builds by adding 'export FORCE_BUNDLING=true' to the script under "
337
+ "\"Build Phases\" > \"Bundle React Native code and images\" (React Native >=0.48 only).\n\n"
359
338
 
360
- "3. Force the JS bundle to be generated in simulator builds by removing the if block that echoes "
361
- "\"Skipping bundling for Simulator platform\" in the \"node_modules/react-native/packager/react-native-xcode.sh\" file (React Native <=0.47 only)\n\n"
339
+ "3. Force the JS bundle to be generated in simulator builds by removing the if block that echoes "
340
+ "\"Skipping bundling for Simulator platform\" in the \"node_modules/react-native/packager/react-native-xcode.sh\" file (React Native <=0.47 only)\n\n"
362
341
 
363
- "4. Deploy a Release build to the simulator, which unlike Debug builds, will generate the JS bundle (React Native >=0.22.0 only).";
364
- #else
365
- errorMessage = [NSString stringWithFormat:@"The specified JS bundle file wasn't found within the app's binary. Is \"%@\" the correct file name?", [bundleResourceName stringByAppendingPathExtension:bundleResourceExtension]];
366
- #endif
367
- #else
342
+ "4. Deploy a Release build to the simulator, which unlike Debug builds, will generate the JS bundle (React Native >=0.22.0 only).";
343
+ #else
344
+ errorMessage = [NSString stringWithFormat:@"The specified JS bundle file wasn't found within the app's binary. Is \"%@\" the correct file name?", [bundleResourceName stringByAppendingPathExtension:bundleResourceExtension]];
345
+ #endif
346
+ #else
368
347
  errorMessage = @"Something went wrong. Please verify if generated JS bundle is correct. ";
369
- #endif
348
+ #endif
370
349
 
371
350
  RCTFatal([CodePushErrorUtils errorWithMessage:errorMessage]);
372
351
  }
@@ -396,7 +375,6 @@ static NSString *const LatestRollbackCountKey = @"count";
396
375
  #ifdef DEBUG
397
376
  [self clearDebugUpdates];
398
377
  #endif
399
- self.paused = YES;
400
378
  NSUserDefaults *preferences = [NSUserDefaults standardUserDefaults];
401
379
  NSDictionary *pendingUpdate = [preferences objectForKey:PendingUpdateKey];
402
380
  if (pendingUpdate) {
@@ -517,8 +495,8 @@ static NSString *const LatestRollbackCountKey = @"count";
517
495
  // If there is a pending update whose "state" isn't loading, then we consider it "pending".
518
496
  // Additionally, if a specific hash was provided, we ensure it matches that of the pending update.
519
497
  BOOL updateIsPending = pendingUpdate &&
520
- [pendingUpdate[PendingUpdateIsLoadingKey] boolValue] == NO &&
521
- (!packageHash || [pendingUpdate[PendingUpdateHashKey] isEqualToString:packageHash]);
498
+ [pendingUpdate[PendingUpdateIsLoadingKey] boolValue] == NO &&
499
+ (!packageHash || [pendingUpdate[PendingUpdateHashKey] isEqualToString:packageHash]);
522
500
 
523
501
  return updateIsPending;
524
502
  }
@@ -690,10 +668,10 @@ static NSString *const LatestRollbackCountKey = @"count";
690
668
 
691
669
  if (_installMode == CodePushInstallModeOnNextSuspend && [[self class] isPendingUpdate:nil]) {
692
670
  _appSuspendTimer = [NSTimer scheduledTimerWithTimeInterval:_minimumBackgroundDuration
693
- target:self
694
- selector:@selector(loadBundleOnTick:)
695
- userInfo:nil
696
- repeats:NO];
671
+ target:self
672
+ selector:@selector(loadBundleOnTick:)
673
+ userInfo:nil
674
+ repeats:NO];
697
675
  }
698
676
  }
699
677
 
@@ -708,8 +686,8 @@ static NSString *const LatestRollbackCountKey = @"count";
708
686
  */
709
687
  RCT_EXPORT_METHOD(downloadUpdate:(NSDictionary*)updatePackage
710
688
  notifyProgress:(BOOL)notifyProgress
711
- resolver:(RCTPromiseResolveBlock)resolve
712
- rejecter:(RCTPromiseRejectBlock)reject)
689
+ resolver:(RCTPromiseResolveBlock)resolve
690
+ rejecter:(RCTPromiseRejectBlock)reject)
713
691
  {
714
692
  NSDictionary *mutableUpdatePackage = [updatePackage mutableCopy];
715
693
  NSURL *binaryBundleURL = [CodePush binaryBundleURL];
@@ -718,56 +696,46 @@ RCT_EXPORT_METHOD(downloadUpdate:(NSDictionary*)updatePackage
718
696
  forKey:BinaryBundleDateKey];
719
697
  }
720
698
 
721
- if (notifyProgress) {
722
- // Set up and unpause the frame observer so that it can emit
723
- // progress events every frame if the progress is updated.
724
- _didUpdateProgress = NO;
725
- self.paused = NO;
726
- }
727
-
728
699
  NSString * publicKey = [[CodePushConfig current] publicKey];
729
700
 
730
701
  [CodePushPackage
731
- downloadPackage:mutableUpdatePackage
732
- expectedBundleFileName:[bundleResourceName stringByAppendingPathExtension:bundleResourceExtension]
733
- publicKey:publicKey
734
- operationQueue:_methodQueue
735
- // The download is progressing forward
736
- progressCallback:^(long long expectedContentLength, long long receivedContentLength) {
737
- // Update the download progress so that the frame observer can notify the JS side
738
- _latestExpectedContentLength = expectedContentLength;
739
- _latestReceivedConentLength = receivedContentLength;
740
- _didUpdateProgress = YES;
741
-
742
- // If the download is completed, stop observing frame
743
- // updates and synchronously send the last event.
744
- if (expectedContentLength == receivedContentLength) {
745
- _didUpdateProgress = NO;
746
- self.paused = YES;
702
+ downloadPackage:mutableUpdatePackage
703
+ expectedBundleFileName:[bundleResourceName stringByAppendingPathExtension:bundleResourceExtension]
704
+ publicKey:publicKey
705
+ operationQueue:_methodQueue
706
+ // The download is progressing forward
707
+ progressCallback:^(long long expectedContentLength, long long receivedContentLength) {
708
+ self->_latestExpectedContentLength = expectedContentLength;
709
+ self->_latestReceivedContentLength = receivedContentLength;
710
+
711
+ if (expectedContentLength == receivedContentLength) {
712
+ [self dispatchDownloadProgressEvent];
713
+ } else if (notifyProgress) {
714
+ NSTimeInterval timestamp = [[NSDate date] timeIntervalSince1970];
715
+ if (timestamp - self->_lastProgressEmitTimestamp > 0.3) {
716
+ self->_lastProgressEmitTimestamp = timestamp;
747
717
  [self dispatchDownloadProgressEvent];
748
718
  }
749
719
  }
750
- // The download completed
751
- doneCallback:^{
752
- NSError *err;
753
- NSDictionary *newPackage = [CodePushPackage getPackage:mutableUpdatePackage[PackageHashKey] error:&err];
720
+ }
721
+ // The download completed
722
+ doneCallback:^{
723
+ NSError *err;
724
+ NSDictionary *newPackage = [CodePushPackage getPackage:mutableUpdatePackage[PackageHashKey] error:&err];
754
725
 
755
- if (err) {
756
- return reject([NSString stringWithFormat: @"%lu", (long)err.code], err.localizedDescription, err);
757
- }
758
- resolve(newPackage);
726
+ if (err) {
727
+ return reject([NSString stringWithFormat: @"%lu", (long)err.code], err.localizedDescription, err);
728
+ }
729
+ resolve(newPackage);
730
+ }
731
+ // The download failed
732
+ failCallback:^(NSError *err) {
733
+ if ([CodePushErrorUtils isCodePushError:err]) {
734
+ [self saveFailedUpdate:mutableUpdatePackage];
759
735
  }
760
- // The download failed
761
- failCallback:^(NSError *err) {
762
- if ([CodePushErrorUtils isCodePushError:err]) {
763
- [self saveFailedUpdate:mutableUpdatePackage];
764
- }
765
736
 
766
- // Stop observing frame updates if the download fails.
767
- _didUpdateProgress = NO;
768
- self.paused = YES;
769
- reject([NSString stringWithFormat: @"%lu", (long)err.code], err.localizedDescription, err);
770
- }];
737
+ reject([NSString stringWithFormat: @"%lu", (long)err.code], err.localizedDescription, err);
738
+ }];
771
739
  }
772
740
 
773
741
  - (void)restartAppInternal:(BOOL)onlyIfUpdateIsPending
@@ -804,7 +772,7 @@ RCT_EXPORT_METHOD(downloadUpdate:(NSDictionary*)updatePackage
804
772
  * app version, as well as the release channel public ID that was configured in the Info.plist file.
805
773
  */
806
774
  RCT_EXPORT_METHOD(getConfiguration:(RCTPromiseResolveBlock)resolve
807
- rejecter:(RCTPromiseRejectBlock)reject)
775
+ rejecter:(RCTPromiseRejectBlock)reject)
808
776
  {
809
777
  NSDictionary *configuration = [[CodePushConfig current] configuration];
810
778
  NSError *error;
@@ -838,8 +806,8 @@ RCT_EXPORT_METHOD(getConfiguration:(RCTPromiseResolveBlock)resolve
838
806
  * This method is the native side of the CodePush.getUpdateMetadata method.
839
807
  */
840
808
  RCT_EXPORT_METHOD(getUpdateMetadata:(CodePushUpdateState)updateState
841
- resolver:(RCTPromiseResolveBlock)resolve
842
- rejecter:(RCTPromiseRejectBlock)reject)
809
+ resolver:(RCTPromiseResolveBlock)resolve
810
+ rejecter:(RCTPromiseRejectBlock)reject)
843
811
  {
844
812
  NSError *error;
845
813
  NSMutableDictionary *package = [[CodePushPackage getCurrentPackage:&error] mutableCopy];
@@ -886,10 +854,10 @@ RCT_EXPORT_METHOD(getUpdateMetadata:(CodePushUpdateState)updateState
886
854
  * This method is the native side of the LocalPackage.install method.
887
855
  */
888
856
  RCT_EXPORT_METHOD(installUpdate:(NSDictionary*)updatePackage
889
- installMode:(CodePushInstallMode)installMode
890
- minimumBackgroundDuration:(int)minimumBackgroundDuration
891
- resolver:(RCTPromiseResolveBlock)resolve
892
- rejecter:(RCTPromiseRejectBlock)reject)
857
+ installMode:(CodePushInstallMode)installMode
858
+ minimumBackgroundDuration:(int)minimumBackgroundDuration
859
+ resolver:(RCTPromiseResolveBlock)resolve
860
+ rejecter:(RCTPromiseRejectBlock)reject)
893
861
  {
894
862
  NSError *error;
895
863
  [CodePushPackage installPackage:updatePackage
@@ -939,8 +907,8 @@ RCT_EXPORT_METHOD(installUpdate:(NSDictionary*)updatePackage
939
907
  * module, and is only used internally to populate the RemotePackage.failedInstall property.
940
908
  */
941
909
  RCT_EXPORT_METHOD(isFailedUpdate:(NSString *)packageHash
942
- resolve:(RCTPromiseResolveBlock)resolve
943
- reject:(RCTPromiseRejectBlock)reject)
910
+ resolve:(RCTPromiseResolveBlock)resolve
911
+ reject:(RCTPromiseRejectBlock)reject)
944
912
  {
945
913
  BOOL isFailedHash = [[self class] isFailedHash:packageHash];
946
914
  resolve(@(isFailedHash));
@@ -967,14 +935,14 @@ RCT_EXPORT_METHOD(getLatestRollbackInfo:(RCTPromiseResolveBlock)resolve
967
935
  * module, and is only used internally to populate the LocalPackage.isFirstRun property.
968
936
  */
969
937
  RCT_EXPORT_METHOD(isFirstRun:(NSString *)packageHash
970
- resolve:(RCTPromiseResolveBlock)resolve
971
- rejecter:(RCTPromiseRejectBlock)reject)
938
+ resolve:(RCTPromiseResolveBlock)resolve
939
+ rejecter:(RCTPromiseRejectBlock)reject)
972
940
  {
973
941
  NSError *error;
974
942
  BOOL isFirstRun = _isFirstRunAfterUpdate
975
- && nil != packageHash
976
- && [packageHash length] > 0
977
- && [packageHash isEqualToString:[CodePushPackage getCurrentPackageHash:&error]];
943
+ && nil != packageHash
944
+ && [packageHash length] > 0
945
+ && [packageHash isEqualToString:[CodePushPackage getCurrentPackageHash:&error]];
978
946
 
979
947
  resolve(@(isFirstRun));
980
948
  }
@@ -983,14 +951,14 @@ RCT_EXPORT_METHOD(isFirstRun:(NSString *)packageHash
983
951
  * This method is the native side of the CodePush.notifyApplicationReady() method.
984
952
  */
985
953
  RCT_EXPORT_METHOD(notifyApplicationReady:(RCTPromiseResolveBlock)resolve
986
- rejecter:(RCTPromiseRejectBlock)reject)
954
+ rejecter:(RCTPromiseRejectBlock)reject)
987
955
  {
988
956
  [CodePush removePendingUpdate];
989
957
  resolve(nil);
990
958
  }
991
959
 
992
960
  RCT_EXPORT_METHOD(allow:(RCTPromiseResolveBlock)resolve
993
- rejecter:(RCTPromiseRejectBlock)reject)
961
+ rejecter:(RCTPromiseRejectBlock)reject)
994
962
  {
995
963
  CPLog(@"Re-allowing restarts.");
996
964
  _allowed = YES;
@@ -1006,14 +974,14 @@ RCT_EXPORT_METHOD(allow:(RCTPromiseResolveBlock)resolve
1006
974
  }
1007
975
 
1008
976
  RCT_EXPORT_METHOD(clearPendingRestart:(RCTPromiseResolveBlock)resolve
1009
- rejecter:(RCTPromiseRejectBlock)reject)
977
+ rejecter:(RCTPromiseRejectBlock)reject)
1010
978
  {
1011
979
  [_restartQueue removeAllObjects];
1012
980
  resolve(nil);
1013
981
  }
1014
982
 
1015
983
  RCT_EXPORT_METHOD(disallow:(RCTPromiseResolveBlock)resolve
1016
- rejecter:(RCTPromiseRejectBlock)reject)
984
+ rejecter:(RCTPromiseRejectBlock)reject)
1017
985
  {
1018
986
  CPLog(@"Disallowing restarts.");
1019
987
  _allowed = NO;
@@ -1024,8 +992,8 @@ RCT_EXPORT_METHOD(disallow:(RCTPromiseResolveBlock)resolve
1024
992
  * This method is the native side of the CodePush.restartApp() method.
1025
993
  */
1026
994
  RCT_EXPORT_METHOD(restartApp:(BOOL)onlyIfUpdateIsPending
1027
- resolve:(RCTPromiseResolveBlock)resolve
1028
- rejecter:(RCTPromiseRejectBlock)reject)
995
+ resolve:(RCTPromiseResolveBlock)resolve
996
+ rejecter:(RCTPromiseRejectBlock)reject)
1029
997
  {
1030
998
  [self restartAppInternal:onlyIfUpdateIsPending];
1031
999
  resolve(nil);
@@ -1043,12 +1011,40 @@ RCT_EXPORT_METHOD(clearUpdates) {
1043
1011
  }
1044
1012
 
1045
1013
  RCT_EXPORT_METHOD(resetClientUniqueId:(RCTPromiseResolveBlock)resolve
1046
- rejecter:(RCTPromiseRejectBlock)reject)
1014
+ rejecter:(RCTPromiseRejectBlock)reject)
1047
1015
  {
1048
1016
  CPLog(@"On iOS, resetting client device ID does nothing as it is the iOS IDFV.");
1049
1017
  resolve([[CodePushConfig current] clientUniqueId]);
1050
1018
  }
1051
1019
 
1020
+ RCT_EXPORT_METHOD(setTelemetryEnabled:(BOOL)enabled
1021
+ resolver:(RCTPromiseResolveBlock)resolve
1022
+ rejecter:(RCTPromiseRejectBlock)reject)
1023
+ {
1024
+ [[CodePushConfig current] setTelemetryEnabled:enabled];
1025
+ resolve(nil);
1026
+ }
1027
+
1028
+ RCT_EXPORT_METHOD(getTelemetryEnabled:(RCTPromiseResolveBlock)resolve
1029
+ rejecter:(RCTPromiseRejectBlock)reject)
1030
+ {
1031
+ resolve(@([[CodePushConfig current] telemetryEnabled]));
1032
+ }
1033
+
1034
+ RCT_EXPORT_METHOD(setDataTransmissionEnabled:(BOOL)enabled
1035
+ resolver:(RCTPromiseResolveBlock)resolve
1036
+ rejecter:(RCTPromiseRejectBlock)reject)
1037
+ {
1038
+ [[CodePushConfig current] setDataTransmissionEnabled:enabled];
1039
+ resolve(nil);
1040
+ }
1041
+
1042
+ RCT_EXPORT_METHOD(getDataTransmissionEnabled:(RCTPromiseResolveBlock)resolve
1043
+ rejecter:(RCTPromiseRejectBlock)reject)
1044
+ {
1045
+ resolve(@([[CodePushConfig current] dataTransmissionEnabled]));
1046
+ }
1047
+
1052
1048
  #pragma mark - JavaScript-exported module methods (Private)
1053
1049
 
1054
1050
  /*
@@ -1069,7 +1065,7 @@ RCT_EXPORT_METHOD(downloadAndReplaceCurrentBundle:(NSString *)remoteBundleUrl)
1069
1065
  * or an update failed) and return its details (version label, status).
1070
1066
  */
1071
1067
  RCT_EXPORT_METHOD(getNewStatusReport:(RCTPromiseResolveBlock)resolve
1072
- rejecter:(RCTPromiseRejectBlock)reject)
1068
+ rejecter:(RCTPromiseRejectBlock)reject)
1073
1069
  {
1074
1070
  if (needToReportRollback) {
1075
1071
  needToReportRollback = NO;
@@ -1114,16 +1110,4 @@ RCT_EXPORT_METHOD(saveStatusReportForRetry:(NSDictionary *)statusReport)
1114
1110
  [CodePushTelemetryManager saveStatusReportForRetry:statusReport];
1115
1111
  }
1116
1112
 
1117
- #pragma mark - RCTFrameUpdateObserver Methods
1118
-
1119
- - (void)didUpdateFrame:(RCTFrameUpdate *)update
1120
- {
1121
- if (!_didUpdateProgress) {
1122
- return;
1123
- }
1124
-
1125
- [self dispatchDownloadProgressEvent];
1126
- _didUpdateProgress = NO;
1127
- }
1128
-
1129
1113
  @end