@appzung/react-native-code-push 11.0.0-rc6 → 11.0.0-rc8

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 (35) hide show
  1. package/CodePush.podspec +3 -5
  2. package/README.md +1 -1
  3. package/android/app/proguard-rules.pro +5 -0
  4. package/ios/CodePush/CodePush.h +8 -6
  5. package/ios/CodePush/{CodePush.m → CodePush.mm} +104 -148
  6. package/ios/CodePush.xcodeproj/project.pbxproj +6 -6
  7. package/lib/commonjs/CodePush.js.map +1 -1
  8. package/lib/commonjs/internals/CodePushEventEmitter.js +10 -0
  9. package/lib/commonjs/internals/CodePushEventEmitter.js.map +1 -0
  10. package/lib/commonjs/internals/RemotePackageImplementation.js +2 -3
  11. package/lib/commonjs/internals/RemotePackageImplementation.js.map +1 -1
  12. package/lib/commonjs/internals/version.js +1 -1
  13. package/lib/module/CodePush.js.map +1 -1
  14. package/lib/module/internals/CodePushEventEmitter.js +6 -0
  15. package/lib/module/internals/CodePushEventEmitter.js.map +1 -0
  16. package/lib/module/internals/RemotePackageImplementation.js +2 -3
  17. package/lib/module/internals/RemotePackageImplementation.js.map +1 -1
  18. package/lib/module/internals/version.js +1 -1
  19. package/lib/typescript/commonjs/src/CodePush.d.ts +2 -2
  20. package/lib/typescript/commonjs/src/CodePush.d.ts.map +1 -1
  21. package/lib/typescript/commonjs/src/internals/CodePushEventEmitter.d.ts +3 -0
  22. package/lib/typescript/commonjs/src/internals/CodePushEventEmitter.d.ts.map +1 -0
  23. package/lib/typescript/commonjs/src/internals/RemotePackageImplementation.d.ts.map +1 -1
  24. package/lib/typescript/commonjs/src/internals/version.d.ts +1 -1
  25. package/lib/typescript/module/src/CodePush.d.ts +2 -2
  26. package/lib/typescript/module/src/CodePush.d.ts.map +1 -1
  27. package/lib/typescript/module/src/internals/CodePushEventEmitter.d.ts +3 -0
  28. package/lib/typescript/module/src/internals/CodePushEventEmitter.d.ts.map +1 -0
  29. package/lib/typescript/module/src/internals/RemotePackageImplementation.d.ts.map +1 -1
  30. package/lib/typescript/module/src/internals/version.d.ts +1 -1
  31. package/package.json +1 -1
  32. package/src/CodePush.tsx +4 -2
  33. package/src/internals/CodePushEventEmitter.ts +4 -0
  34. package/src/internals/RemotePackageImplementation.ts +2 -3
  35. package/src/internals/version.ts +1 -1
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
@@ -20,6 +20,11 @@
20
20
  -keepclassmembers class com.facebook.react.ReactInstanceManager {
21
21
  private final ** mBundleLoader;
22
22
  }
23
+ -keepclassmembers class com.facebook.react.runtime.ReactHostImpl {
24
+ private final ** mReactHostDelegate;
25
+ }
26
+ -keep interface com.facebook.react.runtime.ReactHostDelegate { *; }
27
+ -keep class * implements com.facebook.react.runtime.ReactHostDelegate { *; }
23
28
 
24
29
  # Can't find referenced class org.bouncycastle.**
25
30
  -dontwarn com.nimbusds.jose.**
@@ -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
@@ -222,8 +216,16 @@ failCallback:(void (^)(NSError *err))failCallback;
222
216
 
223
217
  @end
224
218
 
219
+ #ifdef __cplusplus
220
+ extern "C" {
221
+ #endif
222
+
225
223
  void CPLog(NSString *formatString, ...);
226
224
 
225
+ #ifdef __cplusplus
226
+ }
227
+ #endif
228
+
227
229
  typedef NS_ENUM(NSInteger, CodePushInstallMode) {
228
230
  CodePushInstallModeImmediate,
229
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,36 +1011,36 @@ 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
 
1052
1020
  RCT_EXPORT_METHOD(setTelemetryEnabled:(BOOL)enabled
1053
- resolver:(RCTPromiseResolveBlock)resolve
1054
- rejecter:(RCTPromiseRejectBlock)reject)
1021
+ resolver:(RCTPromiseResolveBlock)resolve
1022
+ rejecter:(RCTPromiseRejectBlock)reject)
1055
1023
  {
1056
1024
  [[CodePushConfig current] setTelemetryEnabled:enabled];
1057
1025
  resolve(nil);
1058
1026
  }
1059
1027
 
1060
1028
  RCT_EXPORT_METHOD(getTelemetryEnabled:(RCTPromiseResolveBlock)resolve
1061
- rejecter:(RCTPromiseRejectBlock)reject)
1029
+ rejecter:(RCTPromiseRejectBlock)reject)
1062
1030
  {
1063
1031
  resolve(@([[CodePushConfig current] telemetryEnabled]));
1064
1032
  }
1065
1033
 
1066
1034
  RCT_EXPORT_METHOD(setDataTransmissionEnabled:(BOOL)enabled
1067
- resolver:(RCTPromiseResolveBlock)resolve
1068
- rejecter:(RCTPromiseRejectBlock)reject)
1035
+ resolver:(RCTPromiseResolveBlock)resolve
1036
+ rejecter:(RCTPromiseRejectBlock)reject)
1069
1037
  {
1070
1038
  [[CodePushConfig current] setDataTransmissionEnabled:enabled];
1071
1039
  resolve(nil);
1072
1040
  }
1073
1041
 
1074
1042
  RCT_EXPORT_METHOD(getDataTransmissionEnabled:(RCTPromiseResolveBlock)resolve
1075
- rejecter:(RCTPromiseRejectBlock)reject)
1043
+ rejecter:(RCTPromiseRejectBlock)reject)
1076
1044
  {
1077
1045
  resolve(@([[CodePushConfig current] dataTransmissionEnabled]));
1078
1046
  }
@@ -1097,7 +1065,7 @@ RCT_EXPORT_METHOD(downloadAndReplaceCurrentBundle:(NSString *)remoteBundleUrl)
1097
1065
  * or an update failed) and return its details (version label, status).
1098
1066
  */
1099
1067
  RCT_EXPORT_METHOD(getNewStatusReport:(RCTPromiseResolveBlock)resolve
1100
- rejecter:(RCTPromiseRejectBlock)reject)
1068
+ rejecter:(RCTPromiseRejectBlock)reject)
1101
1069
  {
1102
1070
  if (needToReportRollback) {
1103
1071
  needToReportRollback = NO;
@@ -1142,16 +1110,4 @@ RCT_EXPORT_METHOD(saveStatusReportForRetry:(NSDictionary *)statusReport)
1142
1110
  [CodePushTelemetryManager saveStatusReportForRetry:statusReport];
1143
1111
  }
1144
1112
 
1145
- #pragma mark - RCTFrameUpdateObserver Methods
1146
-
1147
- - (void)didUpdateFrame:(RCTFrameUpdate *)update
1148
- {
1149
- if (!_didUpdateProgress) {
1150
- return;
1151
- }
1152
-
1153
- [self dispatchDownloadProgressEvent];
1154
- _didUpdateProgress = NO;
1155
- }
1156
-
1157
1113
  @end
@@ -7,7 +7,7 @@
7
7
  objects = {
8
8
 
9
9
  /* Begin PBXBuildFile section */
10
- 13BE3DEE1AC21097009241FE /* CodePush.m in Sources */ = {isa = PBXBuildFile; fileRef = 13BE3DED1AC21097009241FE /* CodePush.m */; };
10
+ 13BE3DEE1AC21097009241FE /* CodePush.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13BE3DED1AC21097009241FE /* CodePush.mm */; };
11
11
  1B23B9141BF9267B000BB2F0 /* RCTConvert+CodePushInstallMode.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B23B9131BF9267B000BB2F0 /* RCTConvert+CodePushInstallMode.m */; };
12
12
  1B762E901C9A5E9A006EF800 /* CodePushErrorUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B762E8F1C9A5E9A006EF800 /* CodePushErrorUtils.m */; };
13
13
  1BCC09A71CC19EB700DDC0DD /* RCTConvert+CodePushUpdateState.m in Sources */ = {isa = PBXBuildFile; fileRef = 1BCC09A61CC19EB700DDC0DD /* RCTConvert+CodePushUpdateState.m */; };
@@ -16,7 +16,7 @@
16
16
  5498D8F61D21F14100B5EB43 /* CodePushUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 5498D8F51D21F14100B5EB43 /* CodePushUtils.m */; };
17
17
  54FFEDE01BF550630061DD23 /* CodePushDownloadHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 54FFEDDF1BF550630061DD23 /* CodePushDownloadHandler.m */; };
18
18
  6463C82D1EBA0CFB0095B8CD /* CodePushUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 5498D8F51D21F14100B5EB43 /* CodePushUtils.m */; };
19
- 6463C82E1EBA0CFB0095B8CD /* CodePush.m in Sources */ = {isa = PBXBuildFile; fileRef = 13BE3DED1AC21097009241FE /* CodePush.m */; };
19
+ 6463C82E1EBA0CFB0095B8CD /* CodePush.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13BE3DED1AC21097009241FE /* CodePush.mm */; };
20
20
  6463C82F1EBA0CFB0095B8CD /* CodePushConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = 81D51F391B6181C2000DA084 /* CodePushConfig.m */; };
21
21
  6463C8301EBA0CFB0095B8CD /* CodePushDownloadHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 54FFEDDF1BF550630061DD23 /* CodePushDownloadHandler.m */; };
22
22
  6463C8311EBA0CFB0095B8CD /* CodePushErrorUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B762E8F1C9A5E9A006EF800 /* CodePushErrorUtils.m */; };
@@ -59,7 +59,7 @@
59
59
  /* Begin PBXFileReference section */
60
60
  134814201AA4EA6300B7C361 /* libCodePush.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libCodePush.a; sourceTree = BUILT_PRODUCTS_DIR; };
61
61
  13BE3DEC1AC21097009241FE /* CodePush.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CodePush.h; path = CodePush/CodePush.h; sourceTree = "<group>"; };
62
- 13BE3DED1AC21097009241FE /* CodePush.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CodePush.m; path = CodePush/CodePush.m; sourceTree = "<group>"; };
62
+ 13BE3DED1AC21097009241FE /* CodePush.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = CodePush.mm; path = CodePush/CodePush.mm; sourceTree = "<group>"; };
63
63
  1B23B9131BF9267B000BB2F0 /* RCTConvert+CodePushInstallMode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "RCTConvert+CodePushInstallMode.m"; path = "CodePush/RCTConvert+CodePushInstallMode.m"; sourceTree = "<group>"; };
64
64
  1B762E8F1C9A5E9A006EF800 /* CodePushErrorUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CodePushErrorUtils.m; path = CodePush/CodePushErrorUtils.m; sourceTree = "<group>"; };
65
65
  1BCC09A61CC19EB700DDC0DD /* RCTConvert+CodePushUpdateState.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "RCTConvert+CodePushUpdateState.m"; path = "CodePush/RCTConvert+CodePushUpdateState.m"; sourceTree = "<group>"; };
@@ -105,7 +105,7 @@
105
105
  FF90DEF92C5A808600CA8692 /* PrivacyInfo.xcprivacy */,
106
106
  5498D8F51D21F14100B5EB43 /* CodePushUtils.m */,
107
107
  13BE3DEC1AC21097009241FE /* CodePush.h */,
108
- 13BE3DED1AC21097009241FE /* CodePush.m */,
108
+ 13BE3DED1AC21097009241FE /* CodePush.mm */,
109
109
  81D51F391B6181C2000DA084 /* CodePushConfig.m */,
110
110
  54FFEDDF1BF550630061DD23 /* CodePushDownloadHandler.m */,
111
111
  1B762E8F1C9A5E9A006EF800 /* CodePushErrorUtils.m */,
@@ -233,7 +233,7 @@
233
233
  81D51F3A1B6181C2000DA084 /* CodePushConfig.m in Sources */,
234
234
  54FFEDE01BF550630061DD23 /* CodePushDownloadHandler.m in Sources */,
235
235
  5421FE311C58AD5A00986A55 /* CodePushTelemetryManager.m in Sources */,
236
- 13BE3DEE1AC21097009241FE /* CodePush.m in Sources */,
236
+ 13BE3DEE1AC21097009241FE /* CodePush.mm in Sources */,
237
237
  1B762E901C9A5E9A006EF800 /* CodePushErrorUtils.m in Sources */,
238
238
  5498D8F61D21F14100B5EB43 /* CodePushUtils.m in Sources */,
239
239
  810D4E6D1B96935000B397E9 /* CodePushPackage.m in Sources */,
@@ -245,7 +245,7 @@
245
245
  buildActionMask = 2147483647;
246
246
  files = (
247
247
  6463C82D1EBA0CFB0095B8CD /* CodePushUtils.m in Sources */,
248
- 6463C82E1EBA0CFB0095B8CD /* CodePush.m in Sources */,
248
+ 6463C82E1EBA0CFB0095B8CD /* CodePush.mm in Sources */,
249
249
  6463C82F1EBA0CFB0095B8CD /* CodePushConfig.m in Sources */,
250
250
  6463C8301EBA0CFB0095B8CD /* CodePushDownloadHandler.m in Sources */,
251
251
  6463C8311EBA0CFB0095B8CD /* CodePushErrorUtils.m in Sources */,
@@ -1 +1 @@
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,IAAAQ,WAAA,GAAAR,OAAA;AAAA,SAAAD,uBAAAU,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,EAAG;QAClB,IAAAC,QAAG,EAACC,sBAAQ,CAACC,KAAK,EAAE,gBAA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;QACF;MACF;MAEAS,MAAMA,CAAA,EAAG;QACP,MAAM3B,KAAK,GAAG;UAAE,GAAG,IAAI,CAACA;QAAM,CAAC;;QAE/B;QACA;QACA,IAAIL,aAAa,CAACiC,SAAS,IAAIjC,aAAa,CAACiC,SAAS,CAACD,MAAM,EAAE;UAC7D;UACA3B,KAAK,CAAC6B,GAAG,GAAG,IAAI,CAAC5B,gBAAgB;QACnC;QAEA,oBAAO,IAAAd,WAAA,CAAA2C,GAAA,EAACnC,aAAa;UAAA,GAAKK;QAAK,CAAG,CAAC;MACrC;IACF;IAEA,OAAO,IAAA+B,6BAAY,EAACnC,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,IAAAsC,QAAA,GAAAC,OAAA,CAAA3C,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,IAAA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AACnC,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,IAAAsC,QAAA,GAAAC,OAAA,CAAA3C,OAAA,GAEcC,YAAY","ignoreList":[]}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.CodePushEventEmitter = void 0;
7
+ var _reactNative = require("react-native");
8
+ var _NativeRNAppZungCodePushModule = require("./NativeRNAppZungCodePushModule.js");
9
+ const CodePushEventEmitter = exports.CodePushEventEmitter = new _reactNative.NativeEventEmitter(_NativeRNAppZungCodePushModule.NativeRNAppZungCodePushModule);
10
+ //# sourceMappingURL=CodePushEventEmitter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_NativeRNAppZungCodePushModule","CodePushEventEmitter","exports","NativeEventEmitter","NativeRNAppZungCodePushModule"],"sourceRoot":"../../../src","sources":["internals/CodePushEventEmitter.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,8BAAA,GAAAD,OAAA;AAEO,MAAME,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,GAAG,IAAIE,+BAAkB,CAACC,4DAA6B,CAAC","ignoreList":[]}
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.RemotePackageImpl = void 0;
7
- var _reactNative = require("react-native");
8
7
  var _LogLevelEnum = require("../enums/LogLevel.enum.js");
8
+ var _CodePushEventEmitter = require("./CodePushEventEmitter.js");
9
9
  var _LocalPackageImplementation = require("./LocalPackageImplementation.js");
10
10
  var _NativeRNAppZungCodePushModule = require("./NativeRNAppZungCodePushModule.js");
11
11
  var _log = require("./utils/log.js");
@@ -18,9 +18,8 @@ class RemotePackageImpl {
18
18
  }
19
19
  let downloadProgressSubscription;
20
20
  if (downloadProgressCallback) {
21
- const codePushEventEmitter = new _reactNative.NativeEventEmitter(_NativeRNAppZungCodePushModule.NativeRNAppZungCodePushModule);
22
21
  // Use event subscription to obtain download progress.
23
- downloadProgressSubscription = codePushEventEmitter.addListener('CodePushDownloadProgress', downloadProgressCallback);
22
+ downloadProgressSubscription = _CodePushEventEmitter.CodePushEventEmitter.addListener('CodePushDownloadProgress', downloadProgressCallback);
24
23
  }
25
24
 
26
25
  // Use the downloaded package info. Native code will save the package info
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_LogLevelEnum","_LocalPackageImplementation","_NativeRNAppZungCodePushModule","_log","RemotePackageImpl","constructor","remotePackageData","reportStatusDownload","Object","assign","download","downloadProgressCallback","downloadUrl","Error","downloadProgressSubscription","codePushEventEmitter","NativeEventEmitter","NativeRNAppZungCodePushModule","addListener","updatePackageCopy","downloadedPackage","downloadUpdate","timeoutPromise","Promise","resolve","setTimeout","reportPromise","label","catch","error","log","LogLevel","ERROR","race","LocalPackageImplementation","remove","isPending","exports"],"sourceRoot":"../../../src","sources":["internals/RemotePackageImplementation.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAGA,IAAAE,2BAAA,GAAAF,OAAA;AACA,IAAAG,8BAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AAEO,MAAMK,iBAAiB,CAA0B;EACtDC,WAAWA,CACTC,iBAAkD,EAClDC,oBAA2F,EAC3F;IACAC,MAAM,CAACC,MAAM,CAAC,IAAI,EAAEH,iBAAiB,CAAC;IAEtC,IAAI,CAACI,QAAQ,GAAG,MAAOC,wBAAmD,IAAK;MAC7E,IAAI,CAAC,IAAI,CAACC,WAAW,EAAE;QACrB,MAAM,IAAIC,KAAK,CAAC,kDAAkD,CAAC;MACrE;MAEA,IAAIC,4BAA4B;MAEhC,IAAIH,wBAAwB,EAAE;QAC5B,MAAMI,oBAAoB,GAAG,IAAIC,+BAAkB,CAACC,4DAA6B,CAAC;QAClF;QACAH,4BAA4B,GAAGC,oBAAoB,CAACG,WAAW,CAC7D,0BAA0B,EAC1BP,wBACF,CAAC;MACH;;MAEA;MACA;MACA,IAAI;QACF,MAAM;UAAE,GAAGQ;QAAkB,CAAC,GAAGb,iBAAiB,CAAC,CAAC;QACpD,MAAMc,iBAAiB,GAAG,MAAMH,4DAA6B,CAACI,cAAc,CAC1EF,iBAAiB,EACjB,CAAC,CAACR,wBACJ,CAAC;QAED,IAAIJ,oBAAoB,EAAE;UACxB,MAAMe,cAAc,GAAG,IAAIC,OAAO,CAAQC,OAAO,IAAKC,UAAU,CAACD,OAAO,EAAE,GAAG,CAAC,CAAC;UAC/E,MAAME,aAAa,GAAGnB,oBAAoB,CAAC;YACzCoB,KAAK,EAAE,IAAI,CAACA;UACd,CAAC,CAAC,CAACC,KAAK,CAAEC,KAAK,IAAK;YAClB,IAAAC,QAAG,EAACC,sBAAQ,CAACC,KAAK,EAAE,kCAAkCH,KAAK,EAAE,CAAC;UAChE,CAAC,CAAC;UACF,MAAMN,OAAO,CAACU,IAAI,CAAC,CAACX,cAAc,EAAEI,aAAa,CAAC,CAAC;QACrD;QAEA,OAAO,IAAIQ,sDAA0B,CAACd,iBAAiB,CAAC;MAC1D,CAAC,SAAS;QACRN,4BAA4B,IAAIA,4BAA4B,CAACqB,MAAM,CAAC,CAAC;MACvE;IACF,CAAC;EACH;EAUAC,SAAS,GAAG,KAAK,CAAC,CAAC;AAKrB;AAACC,OAAA,CAAAjC,iBAAA,GAAAA,iBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_LogLevelEnum","require","_CodePushEventEmitter","_LocalPackageImplementation","_NativeRNAppZungCodePushModule","_log","RemotePackageImpl","constructor","remotePackageData","reportStatusDownload","Object","assign","download","downloadProgressCallback","downloadUrl","Error","downloadProgressSubscription","CodePushEventEmitter","addListener","updatePackageCopy","downloadedPackage","NativeRNAppZungCodePushModule","downloadUpdate","timeoutPromise","Promise","resolve","setTimeout","reportPromise","label","catch","error","log","LogLevel","ERROR","race","LocalPackageImplementation","remove","isPending","exports"],"sourceRoot":"../../../src","sources":["internals/RemotePackageImplementation.ts"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AAGA,IAAAC,qBAAA,GAAAD,OAAA;AACA,IAAAE,2BAAA,GAAAF,OAAA;AACA,IAAAG,8BAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AAEO,MAAMK,iBAAiB,CAA0B;EACtDC,WAAWA,CACTC,iBAAkD,EAClDC,oBAA2F,EAC3F;IACAC,MAAM,CAACC,MAAM,CAAC,IAAI,EAAEH,iBAAiB,CAAC;IAEtC,IAAI,CAACI,QAAQ,GAAG,MAAOC,wBAAmD,IAAK;MAC7E,IAAI,CAAC,IAAI,CAACC,WAAW,EAAE;QACrB,MAAM,IAAIC,KAAK,CAAC,kDAAkD,CAAC;MACrE;MAEA,IAAIC,4BAA4B;MAEhC,IAAIH,wBAAwB,EAAE;QAC5B;QACAG,4BAA4B,GAAGC,0CAAoB,CAACC,WAAW,CAC7D,0BAA0B,EAC1BL,wBACF,CAAC;MACH;;MAEA;MACA;MACA,IAAI;QACF,MAAM;UAAE,GAAGM;QAAkB,CAAC,GAAGX,iBAAiB,CAAC,CAAC;QACpD,MAAMY,iBAAiB,GAAG,MAAMC,4DAA6B,CAACC,cAAc,CAC1EH,iBAAiB,EACjB,CAAC,CAACN,wBACJ,CAAC;QAED,IAAIJ,oBAAoB,EAAE;UACxB,MAAMc,cAAc,GAAG,IAAIC,OAAO,CAAQC,OAAO,IAAKC,UAAU,CAACD,OAAO,EAAE,GAAG,CAAC,CAAC;UAC/E,MAAME,aAAa,GAAGlB,oBAAoB,CAAC;YACzCmB,KAAK,EAAE,IAAI,CAACA;UACd,CAAC,CAAC,CAACC,KAAK,CAAEC,KAAK,IAAK;YAClB,IAAAC,QAAG,EAACC,sBAAQ,CAACC,KAAK,EAAE,kCAAkCH,KAAK,EAAE,CAAC;UAChE,CAAC,CAAC;UACF,MAAMN,OAAO,CAACU,IAAI,CAAC,CAACX,cAAc,EAAEI,aAAa,CAAC,CAAC;QACrD;QAEA,OAAO,IAAIQ,sDAA0B,CAACf,iBAAiB,CAAC;MAC1D,CAAC,SAAS;QACRJ,4BAA4B,IAAIA,4BAA4B,CAACoB,MAAM,CAAC,CAAC;MACvE;IACF,CAAC;EACH;EAUAC,SAAS,GAAG,KAAK,CAAC,CAAC;AAKrB;AAACC,OAAA,CAAAhC,iBAAA,GAAAA,iBAAA","ignoreList":[]}
@@ -5,5 +5,5 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.version = void 0;
7
7
  // Generated by genversion.
8
- const version = exports.version = '11.0.0-rc6';
8
+ const version = exports.version = '11.0.0-rc8';
9
9
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["hoistStatics","React","AppState","CheckFrequency","LogLevel","log","notifyAppReady","sync","jsx","_jsx","withCodePush","optionsOrComponent","options","WithCodePush","RootComponent","CodePushComponent","Component","constructor","props","rootComponentRef","createRef","componentDidMount","DEBUG","JSON","stringify","checkFrequency","MANUAL","rootComponentInstance","current","syncStatusCallback","codePushStatusDidChange","bind","downloadProgressCallback","codePushDownloadDidProgress","handleBinaryVersionMismatchCallback","codePushOnBinaryVersionMismatch","ON_APP_RESUME","addEventListener","newState","render","prototype","ref"],"sourceRoot":"../../src","sources":["CodePush.tsx"],"mappings":";;AAAA,OAAOA,YAAY,MAAM,yBAAyB;AAClD,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,QAAQ,cAAc;AACvC,SAASC,cAAc,QAAQ,gCAA6B;AAC5D,SAASC,QAAQ,QAAQ,0BAAuB;AAChD,SAASC,GAAG,QAAQ,0BAAuB;AAC3C,SAASC,cAAc,QAAQ,qBAAkB;AACjD,SAASC,IAAI,Q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jCP,qBAAqB,CAACQ,+BAA+B,CAACJ,IAAI,CAACJ,qBAAqB,CAAC;UACrF;UAEAtB,GAAG,CAACD,QAAQ,CAACkB,KAAK,EAAE,eAAe,CAAC;UACpCf,IAAI,CAACK,OAAO,EAAEiB,kBAAkB,EAAEG,wBAAwB,EAAEE,mCAAmC,CAAC;UAEhG,IAAItB,OAAO,CAACa,cAAc,KAAKtB,cAAc,CAACiC,aAAa,EAAE;YAC3DlC,QAAQ,CAACmC,gBAAgB,CAAC,QAAQ,EAAGC,QAAgB,IAAK;cACxD,IAAIA,QAAQ,KAAK,QAAQ,EAAE;gBACzBjC,GAAG,CAACD,QAAQ,CAACkB,KAAK,EAAE,yBAAyB,CAAC;gBAC9Cf,IAAI,CAACK,OAAO,EAAEiB,kBAAkB,EAAEG,wBAAwB,CAAC;cAC7D;YACF,CAAC,CAAC;UACJ;QACF;MACF;MAEAO,MAAMA,CAAA,EAAG;QACP,MAAMrB,KAAK,GAAG;UAAE,GAAG,IAAI,CAACA;QAAM,CAAC;;QAE/B;QACA;QACA,IAAIJ,aAAa,CAAC0B,SAAS,IAAI1B,aAAa,CAAC0B,SAAS,CAACD,MAAM,EAAE;UAC7D;UACArB,KAAK,CAACuB,GAAG,GAAG,IAAI,CAACtB,gBAAgB;QACnC;QAEA,oBAAOV,IAAA,CAACK,aAAa;UAAA,GAAKI;QAAK,CAAG,CAAC;MACrC;IACF;IAEA,OAAOlB,YAAY,CAACe,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;AAEA,eAAeH,YAAY","ignoreList":[]}
1
+ {"version":3,"names":["hoistStatics","React","AppState","CheckFrequency","LogLevel","log","notifyAppReady","sync","jsx","_jsx","withCodePush","optionsOrComponent","options","WithCodePush","RootComponent","CodePushComponent","Component","constructor","props","rootComponentRef","createRef","componentDidMount","DEBUG","JSON","stringify","checkFrequency","MANUAL","rootComponentInstance","current","syncStatusCallback","codePushStatusDidChange","bind","downloadProgressCallback","codePushDownloadDidProgress","handleBinaryVersionMismatchCallback","codePushOnBinaryVersionMismatch","ON_APP_RESUME","addEventListener","newState","render","prototype","ref"],"sourceRoot":"../../src","sources":["CodePush.tsx"],"mappings":";;AAAA,OAAOA,YAAY,MAAM,yBAAyB;AAClD,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,QAAQ,cAAc;AACvC,SAASC,cAAc,QAAQ,gCAA6B;AAC5D,SAASC,QAAQ,QAAQ,0BAAuB;AAChD,SAASC,GAAG,QAAQ,0BAAuB;AAC3C,SAASC,cAAc,QAAQ,qBAAkB;AACjD,SAASC,IAAI,QAAQ,WAAQ;;AAiB7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AANA,SAAAC,GAAA,IAAAC,IAAA;AAWA,OAAO,SAASC,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,SAASd,KAAK,CAACe,SAAS,CAAI;MAGjDC,WAAWA,CAACC,KAAY,EAAE;QACxB,KAAK,CAACA,KAAK,CAAC;QACZ,IAAI,CAACC,gBAAgB,gBAAGlB,KAAK,CAACmB,SAAS,CAAC,CAAC;MAC3C;MAEAC,iBAAiBA,CAAA,EAAG;QAClBhB,GAAG,CAACD,QAAQ,CAACkB,KAAK,EAAE,gBAAgBC,IAAI,CAACC,SAAS,CAACZ,OAAO,CAAC,EAAE,CAAC;QAE9D,IAAIA,OAAO,CAACa,cAAc,KAAKtB,cAAc,CAACuB,MAAM,EAAE;UACpDpB,cAAc,CAAC,CAAC;QAClB,CAA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E;UAC7D;UACArB,KAAK,CAACuB,GAAG,GAAG,IAAI,CAACtB,gBAAgB;QACnC;QAEA,oBAAOV,IAAA,CAACK,aAAa;UAAA,GAAKI;QAAK,CAAG,CAAC;MACrC;IACF;IAEA,OAAOlB,YAAY,CAACe,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;AAEA,eAAeH,YAAY","ignoreList":[]}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ import { NativeEventEmitter } from 'react-native';
4
+ import { NativeRNAppZungCodePushModule } from "./NativeRNAppZungCodePushModule.js";
5
+ export const CodePushEventEmitter = new NativeEventEmitter(NativeRNAppZungCodePushModule);
6
+ //# sourceMappingURL=CodePushEventEmitter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NativeEventEmitter","NativeRNAppZungCodePushModule","CodePushEventEmitter"],"sourceRoot":"../../../src","sources":["internals/CodePushEventEmitter.ts"],"mappings":";;AAAA,SAASA,kBAAkB,QAAQ,cAAc;AACjD,SAASC,6BAA6B,QAAQ,oCAAiC;AAE/E,OAAO,MAAMC,oBAAoB,GAAG,IAAIF,kBAAkB,CAACC,6BAA6B,CAAC","ignoreList":[]}
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
 
3
- import { NativeEventEmitter } from 'react-native';
4
3
  import { LogLevel } from "../enums/LogLevel.enum.js";
4
+ import { CodePushEventEmitter } from "./CodePushEventEmitter.js";
5
5
  import { LocalPackageImplementation } from "./LocalPackageImplementation.js";
6
6
  import { NativeRNAppZungCodePushModule } from "./NativeRNAppZungCodePushModule.js";
7
7
  import { log } from "./utils/log.js";
@@ -14,9 +14,8 @@ export class RemotePackageImpl {
14
14
  }
15
15
  let downloadProgressSubscription;
16
16
  if (downloadProgressCallback) {
17
- const codePushEventEmitter = new NativeEventEmitter(NativeRNAppZungCodePushModule);
18
17
  // Use event subscription to obtain download progress.
19
- downloadProgressSubscription = codePushEventEmitter.addListener('CodePushDownloadProgress', downloadProgressCallback);
18
+ downloadProgressSubscription = CodePushEventEmitter.addListener('CodePushDownloadProgress', downloadProgressCallback);
20
19
  }
21
20
 
22
21
  // Use the downloaded package info. Native code will save the package info
@@ -1 +1 @@
1
- {"version":3,"names":["NativeEventEmitter","LogLevel","LocalPackageImplementation","NativeRNAppZungCodePushModule","log","RemotePackageImpl","constructor","remotePackageData","reportStatusDownload","Object","assign","download","downloadProgressCallback","downloadUrl","Error","downloadProgressSubscription","codePushEventEmitter","addListener","updatePackageCopy","downloadedPackage","downloadUpdate","timeoutPromise","Promise","resolve","setTimeout","reportPromise","label","catch","error","ERROR","race","remove","isPending"],"sourceRoot":"../../../src","sources":["internals/RemotePackageImplementation.ts"],"mappings":";;AAAA,SAASA,kBAAkB,QAAQ,cAAc;AACjD,SAASC,QAAQ,QAAQ,2BAAwB;AAGjD,SAASC,0BAA0B,QAAQ,iCAA8B;AACzE,SAASC,6BAA6B,QAAQ,oCAAiC;AAC/E,SAASC,GAAG,QAAQ,gBAAa;AAEjC,OAAO,MAAMC,iBAAiB,CAA0B;EACtDC,WAAWA,CACTC,iBAAkD,EAClDC,oBAA2F,EAC3F;IACAC,MAAM,CAACC,MAAM,CAAC,IAAI,EAAEH,iBAAiB,CAAC;IAEtC,IAAI,CAACI,QAAQ,GAAG,MAAOC,wBAAmD,IAAK;MAC7E,IAAI,CAAC,IAAI,CAACC,WAAW,EAAE;QACrB,MAAM,IAAIC,KAAK,CAAC,kDAAkD,CAAC;MACrE;MAEA,IAAIC,4BAA4B;MAEhC,IAAIH,wBAAwB,EAAE;QAC5B,MAAMI,oBAAoB,GAAG,IAAIhB,kBAAkB,CAACG,6BAA6B,CAAC;QAClF;QACAY,4BAA4B,GAAGC,oBAAoB,CAACC,WAAW,CAC7D,0BAA0B,EAC1BL,wBACF,CAAC;MACH;;MAEA;MACA;MACA,IAAI;QACF,MAAM;UAAE,GAAGM;QAAkB,CAAC,GAAGX,iBAAiB,CAAC,CAAC;QACpD,MAAMY,iBAAiB,GAAG,MAAMhB,6BAA6B,CAACiB,cAAc,CAC1EF,iBAAiB,EACjB,CAAC,CAACN,wBACJ,CAAC;QAED,IAAIJ,oBAAoB,EAAE;UACxB,MAAMa,cAAc,GAAG,IAAIC,OAAO,CAAQC,OAAO,IAAKC,UAAU,CAACD,OAAO,EAAE,GAAG,CAAC,CAAC;UAC/E,MAAME,aAAa,GAAGjB,oBAAoB,CAAC;YACzCkB,KAAK,EAAE,IAAI,CAACA;UACd,CAAC,CAAC,CAACC,KAAK,CAAEC,KAAK,IAAK;YAClBxB,GAAG,CAACH,QAAQ,CAAC4B,KAAK,EAAE,kCAAkCD,KAAK,EAAE,CAAC;UAChE,CAAC,CAAC;UACF,MAAMN,OAAO,CAACQ,IAAI,CAAC,CAACT,cAAc,EAAEI,aAAa,CAAC,CAAC;QACrD;QAEA,OAAO,IAAIvB,0BAA0B,CAACiB,iBAAiB,CAAC;MAC1D,CAAC,SAAS;QACRJ,4BAA4B,IAAIA,4BAA4B,CAACgB,MAAM,CAAC,CAAC;MACvE;IACF,CAAC;EACH;EAUAC,SAAS,GAAG,KAAK,CAAC,CAAC;AAKrB","ignoreList":[]}
1
+ {"version":3,"names":["LogLevel","CodePushEventEmitter","LocalPackageImplementation","NativeRNAppZungCodePushModule","log","RemotePackageImpl","constructor","remotePackageData","reportStatusDownload","Object","assign","download","downloadProgressCallback","downloadUrl","Error","downloadProgressSubscription","addListener","updatePackageCopy","downloadedPackage","downloadUpdate","timeoutPromise","Promise","resolve","setTimeout","reportPromise","label","catch","error","ERROR","race","remove","isPending"],"sourceRoot":"../../../src","sources":["internals/RemotePackageImplementation.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,2BAAwB;AAGjD,SAASC,oBAAoB,QAAQ,2BAAwB;AAC7D,SAASC,0BAA0B,QAAQ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4B,CAACe,MAAM,CAAC,CAAC;MACvE;IACF,CAAC;EACH;EAUAC,SAAS,GAAG,KAAK,CAAC,CAAC;AAKrB","ignoreList":[]}
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
 
3
3
  // Generated by genversion.
4
- export const version = '11.0.0-rc6';
4
+ export const version = '11.0.0-rc8';
5
5
  //# sourceMappingURL=version.js.map
@@ -16,7 +16,7 @@ export interface CodePushOptions extends SyncOptions {
16
16
  *
17
17
  * @param component the React Component that will be decorated
18
18
  */
19
- export declare function withCodePush<P extends object>(component: React.ComponentType<P>): React.ComponentType;
19
+ export declare function withCodePush<P extends object | Record<string, unknown>>(component: React.ComponentType<P>): React.ComponentType;
20
20
  /**
21
21
  * Wraps a React component inside a "higher order" React component that knows how to synchronize your app's JavaScript bundle and image assets when it is mounted.
22
22
  *
@@ -24,6 +24,6 @@ export declare function withCodePush<P extends object>(component: React.Componen
24
24
  *
25
25
  * @param options Options used to configure the end-user sync and update experience (e.g. when to check for updates?, show a prompt?, install the update immediately?).
26
26
  */
27
- export declare function withCodePush<P extends object>(options: CodePushOptions): (component: React.ComponentType<P>) => React.ComponentType;
27
+ export declare function withCodePush<P extends object | Record<string, unknown>>(options: CodePushOptions): (component: React.ComponentType<P>) => React.ComponentType;
28
28
  export default withCodePush;
29
29
  //# sourceMappingURL=CodePush.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CodePush.d.ts","sourceRoot":"","sources":["../../../../src/CodePush.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAK7D,OAAO,KAAK,EAGV,WAAW,EAEZ,MAAM,SAAS,CAAC;AAEjB,MAAM,WAAW,eAAgB,SAAQ,WAAW;IAClD;;;;OAIG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC;AAED;;;;;;GAMG;AAEH,wBAAgB,YAAY,CAAC,CAAC,SAAS,MAAM,EAAE,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC;AAEvG;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,MAAM,EAC3C,OAAO,EAAE,eAAe,GACvB,CAAC,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,aAAa,CAAC;AA6E9D,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"CodePush.d.ts","sourceRoot":"","sources":["../../../../src/CodePush.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAK7D,OAAO,KAAK,EAGV,WAAW,EAEZ,MAAM,SAAS,CAAC;AAEjB,MAAM,WAAW,eAAgB,SAAQ,WAAW;IAClD;;;;OAIG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC;AAED;;;;;;GAMG;AAEH,wBAAgB,YAAY,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACrE,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,GAChC,KAAK,CAAC,aAAa,CAAC;AAEvB;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACrE,OAAO,EAAE,eAAe,GACvB,CAAC,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,aAAa,CAAC;AA6E9D,eAAe,YAAY,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { NativeEventEmitter } from 'react-native';
2
+ export declare const CodePushEventEmitter: NativeEventEmitter;
3
+ //# sourceMappingURL=CodePushEventEmitter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CodePushEventEmitter.d.ts","sourceRoot":"","sources":["../../../../../src/internals/CodePushEventEmitter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAGlD,eAAO,MAAM,oBAAoB,oBAAwD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"RemotePackageImplementation.d.ts","sourceRoot":"","sources":["../../../../../src/internals/RemotePackageImplementation.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACtF,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAC;AAK9E,qBAAa,iBAAkB,YAAW,aAAa;gBAEnD,iBAAiB,EAAE,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC,EAClD,oBAAoB,EAAE,CAAC,iBAAiB,EAAE,+BAA+B,KAAK,OAAO,CAAC,IAAI,CAAC;IA8C7F,QAAQ,EAAE,CAAC,wBAAwB,CAAC,EAAE,wBAAwB,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;IAEzF,UAAU,EAAG,MAAM,CAAC;IACpB,WAAW,EAAG,MAAM,CAAC;IACrB,WAAW,EAAG,MAAM,CAAC;IACrB,aAAa,EAAG,OAAO,CAAC;IACxB,UAAU,EAAG,OAAO,CAAC;IACrB,WAAW,EAAG,OAAO,CAAC;IACtB,SAAS,UAAS;IAClB,KAAK,EAAG,MAAM,CAAC;IACf,WAAW,EAAG,MAAM,CAAC;IACrB,WAAW,EAAG,MAAM,CAAC;IACrB,sBAAsB,EAAG,MAAM,CAAC;CACjC"}
1
+ {"version":3,"file":"RemotePackageImplementation.d.ts","sourceRoot":"","sources":["../../../../../src/internals/RemotePackageImplementation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wBAAwB,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACtF,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAC;AAM9E,qBAAa,iBAAkB,YAAW,aAAa;gBAEnD,iBAAiB,EAAE,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC,EAClD,oBAAoB,EAAE,CAAC,iBAAiB,EAAE,+BAA+B,KAAK,OAAO,CAAC,IAAI,CAAC;IA6C7F,QAAQ,EAAE,CAAC,wBAAwB,CAAC,EAAE,wBAAwB,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;IAEzF,UAAU,EAAG,MAAM,CAAC;IACpB,WAAW,EAAG,MAAM,CAAC;IACrB,WAAW,EAAG,MAAM,CAAC;IACrB,aAAa,EAAG,OAAO,CAAC;IACxB,UAAU,EAAG,OAAO,CAAC;IACrB,WAAW,EAAG,OAAO,CAAC;IACtB,SAAS,UAAS;IAClB,KAAK,EAAG,MAAM,CAAC;IACf,WAAW,EAAG,MAAM,CAAC;IACrB,WAAW,EAAG,MAAM,CAAC;IACrB,sBAAsB,EAAG,MAAM,CAAC;CACjC"}
@@ -1,2 +1,2 @@
1
- export declare const version = "11.0.0-rc6";
1
+ export declare const version = "11.0.0-rc8";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -16,7 +16,7 @@ export interface CodePushOptions extends SyncOptions {
16
16
  *
17
17
  * @param component the React Component that will be decorated
18
18
  */
19
- export declare function withCodePush<P extends object>(component: React.ComponentType<P>): React.ComponentType;
19
+ export declare function withCodePush<P extends object | Record<string, unknown>>(component: React.ComponentType<P>): React.ComponentType;
20
20
  /**
21
21
  * Wraps a React component inside a "higher order" React component that knows how to synchronize your app's JavaScript bundle and image assets when it is mounted.
22
22
  *
@@ -24,6 +24,6 @@ export declare function withCodePush<P extends object>(component: React.Componen
24
24
  *
25
25
  * @param options Options used to configure the end-user sync and update experience (e.g. when to check for updates?, show a prompt?, install the update immediately?).
26
26
  */
27
- export declare function withCodePush<P extends object>(options: CodePushOptions): (component: React.ComponentType<P>) => React.ComponentType;
27
+ export declare function withCodePush<P extends object | Record<string, unknown>>(options: CodePushOptions): (component: React.ComponentType<P>) => React.ComponentType;
28
28
  export default withCodePush;
29
29
  //# sourceMappingURL=CodePush.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CodePush.d.ts","sourceRoot":"","sources":["../../../../src/CodePush.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAK7D,OAAO,KAAK,EAGV,WAAW,EAEZ,MAAM,SAAS,CAAC;AAEjB,MAAM,WAAW,eAAgB,SAAQ,WAAW;IAClD;;;;OAIG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC;AAED;;;;;;GAMG;AAEH,wBAAgB,YAAY,CAAC,CAAC,SAAS,MAAM,EAAE,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC;AAEvG;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,MAAM,EAC3C,OAAO,EAAE,eAAe,GACvB,CAAC,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,aAAa,CAAC;AA6E9D,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"CodePush.d.ts","sourceRoot":"","sources":["../../../../src/CodePush.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAK7D,OAAO,KAAK,EAGV,WAAW,EAEZ,MAAM,SAAS,CAAC;AAEjB,MAAM,WAAW,eAAgB,SAAQ,WAAW;IAClD;;;;OAIG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC;AAED;;;;;;GAMG;AAEH,wBAAgB,YAAY,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACrE,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,GAChC,KAAK,CAAC,aAAa,CAAC;AAEvB;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACrE,OAAO,EAAE,eAAe,GACvB,CAAC,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,aAAa,CAAC;AA6E9D,eAAe,YAAY,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { NativeEventEmitter } from 'react-native';
2
+ export declare const CodePushEventEmitter: NativeEventEmitter;
3
+ //# sourceMappingURL=CodePushEventEmitter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CodePushEventEmitter.d.ts","sourceRoot":"","sources":["../../../../../src/internals/CodePushEventEmitter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAGlD,eAAO,MAAM,oBAAoB,oBAAwD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"RemotePackageImplementation.d.ts","sourceRoot":"","sources":["../../../../../src/internals/RemotePackageImplementation.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACtF,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAC;AAK9E,qBAAa,iBAAkB,YAAW,aAAa;gBAEnD,iBAAiB,EAAE,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC,EAClD,oBAAoB,EAAE,CAAC,iBAAiB,EAAE,+BAA+B,KAAK,OAAO,CAAC,IAAI,CAAC;IA8C7F,QAAQ,EAAE,CAAC,wBAAwB,CAAC,EAAE,wBAAwB,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;IAEzF,UAAU,EAAG,MAAM,CAAC;IACpB,WAAW,EAAG,MAAM,CAAC;IACrB,WAAW,EAAG,MAAM,CAAC;IACrB,aAAa,EAAG,OAAO,CAAC;IACxB,UAAU,EAAG,OAAO,CAAC;IACrB,WAAW,EAAG,OAAO,CAAC;IACtB,SAAS,UAAS;IAClB,KAAK,EAAG,MAAM,CAAC;IACf,WAAW,EAAG,MAAM,CAAC;IACrB,WAAW,EAAG,MAAM,CAAC;IACrB,sBAAsB,EAAG,MAAM,CAAC;CACjC"}
1
+ {"version":3,"file":"RemotePackageImplementation.d.ts","sourceRoot":"","sources":["../../../../../src/internals/RemotePackageImplementation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wBAAwB,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACtF,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAC;AAM9E,qBAAa,iBAAkB,YAAW,aAAa;gBAEnD,iBAAiB,EAAE,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC,EAClD,oBAAoB,EAAE,CAAC,iBAAiB,EAAE,+BAA+B,KAAK,OAAO,CAAC,IAAI,CAAC;IA6C7F,QAAQ,EAAE,CAAC,wBAAwB,CAAC,EAAE,wBAAwB,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;IAEzF,UAAU,EAAG,MAAM,CAAC;IACpB,WAAW,EAAG,MAAM,CAAC;IACrB,WAAW,EAAG,MAAM,CAAC;IACrB,aAAa,EAAG,OAAO,CAAC;IACxB,UAAU,EAAG,OAAO,CAAC;IACrB,WAAW,EAAG,OAAO,CAAC;IACtB,SAAS,UAAS;IAClB,KAAK,EAAG,MAAM,CAAC;IACf,WAAW,EAAG,MAAM,CAAC;IACrB,WAAW,EAAG,MAAM,CAAC;IACrB,sBAAsB,EAAG,MAAM,CAAC;CACjC"}
@@ -1,2 +1,2 @@
1
- export declare const version = "11.0.0-rc6";
1
+ export declare const version = "11.0.0-rc8";
2
2
  //# sourceMappingURL=version.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appzung/react-native-code-push",
3
- "version": "11.0.0-rc6",
3
+ "version": "11.0.0-rc8",
4
4
  "description": "React Native plugin for the CodePush service",
5
5
  "author": "Louis Lagrange <lagrange.louis@gmail.com> (https://github.com/Minishlink)",
6
6
  "license": "MIT",
package/src/CodePush.tsx CHANGED
@@ -30,7 +30,9 @@ export interface CodePushOptions extends SyncOptions {
30
30
  * @param component the React Component that will be decorated
31
31
  */
32
32
  // @ts-ignore
33
- export function withCodePush<P extends object>(component: React.ComponentType<P>): React.ComponentType;
33
+ export function withCodePush<P extends object | Record<string, unknown>>(
34
+ component: React.ComponentType<P>,
35
+ ): React.ComponentType;
34
36
 
35
37
  /**
36
38
  * Wraps a React component inside a "higher order" React component that knows how to synchronize your app's JavaScript bundle and image assets when it is mounted.
@@ -39,7 +41,7 @@ export function withCodePush<P extends object>(component: React.ComponentType<P>
39
41
  *
40
42
  * @param options Options used to configure the end-user sync and update experience (e.g. when to check for updates?, show a prompt?, install the update immediately?).
41
43
  */
42
- export function withCodePush<P extends object>(
44
+ export function withCodePush<P extends object | Record<string, unknown>>(
43
45
  options: CodePushOptions,
44
46
  ): (component: React.ComponentType<P>) => React.ComponentType;
45
47
 
@@ -0,0 +1,4 @@
1
+ import { NativeEventEmitter } from 'react-native';
2
+ import { NativeRNAppZungCodePushModule } from './NativeRNAppZungCodePushModule';
3
+
4
+ export const CodePushEventEmitter = new NativeEventEmitter(NativeRNAppZungCodePushModule);
@@ -1,7 +1,7 @@
1
- import { NativeEventEmitter } from 'react-native';
2
1
  import { LogLevel } from '../enums/LogLevel.enum';
3
2
  import type { DownloadProgressCallback, LocalPackage, RemotePackage } from '../types';
4
3
  import type { ApiSdkDownloadReportPackageInfo } from './CodePushApiSdk.types';
4
+ import { CodePushEventEmitter } from './CodePushEventEmitter';
5
5
  import { LocalPackageImplementation } from './LocalPackageImplementation';
6
6
  import { NativeRNAppZungCodePushModule } from './NativeRNAppZungCodePushModule';
7
7
  import { log } from './utils/log';
@@ -21,9 +21,8 @@ export class RemotePackageImpl implements RemotePackage {
21
21
  let downloadProgressSubscription;
22
22
 
23
23
  if (downloadProgressCallback) {
24
- const codePushEventEmitter = new NativeEventEmitter(NativeRNAppZungCodePushModule);
25
24
  // Use event subscription to obtain download progress.
26
- downloadProgressSubscription = codePushEventEmitter.addListener(
25
+ downloadProgressSubscription = CodePushEventEmitter.addListener(
27
26
  'CodePushDownloadProgress',
28
27
  downloadProgressCallback,
29
28
  );
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- export const version = '11.0.0-rc6';
2
+ export const version = '11.0.0-rc8';