@@ -438,7 +438,7 @@ - (void)applicationWillResignActive
438
438
_lastResignedDate = [NSDate date ];
439
439
}
440
440
441
- #pragma mark - JavaScript-exported module methods
441
+ #pragma mark - JavaScript-exported module methods (Public)
442
442
443
443
/*
444
444
* This is native-side of the RemotePackage.download method
@@ -485,7 +485,7 @@ - (void)applicationWillResignActive
485
485
// The download failed
486
486
failCallback: ^(NSError *err) {
487
487
dispatch_async (_methodQueue, ^{
488
- if ([CodePushPackage isCodePushError: err]) {
488
+ if ([CodePushErrorUtils isCodePushError: err]) {
489
489
[self saveFailedUpdate: mutableUpdatePackage];
490
490
}
491
491
@@ -648,6 +648,33 @@ - (void)applicationWillResignActive
648
648
resolve (nil );
649
649
}
650
650
651
+ /*
652
+ * This method is the native side of the CodePush.restartApp() method.
653
+ */
654
+ RCT_EXPORT_METHOD (restartApp:(BOOL )onlyIfUpdateIsPending)
655
+ {
656
+ // If this is an unconditional restart request, or there
657
+ // is current pending update, then reload the app.
658
+ if (!onlyIfUpdateIsPending || [self isPendingUpdate: nil ]) {
659
+ [self loadBundle ];
660
+ }
661
+ }
662
+
663
+ #pragma mark - JavaScript-exported module methods (Private)
664
+
665
+ /*
666
+ * This method is the native side of the CodePush.downloadAndReplaceCurrentBundle()
667
+ * method, which replaces the current bundle with the one downloaded from
668
+ * removeBundleUrl. It is only to be used during tests and no-ops if the test
669
+ * configuration flag is not set.
670
+ */
671
+ RCT_EXPORT_METHOD (downloadAndReplaceCurrentBundle:(NSString *)remoteBundleUrl)
672
+ {
673
+ if ([CodePush isUsingTestConfiguration ]) {
674
+ [CodePushPackage downloadAndReplaceCurrentBundle: remoteBundleUrl];
675
+ }
676
+ }
677
+
651
678
/*
652
679
* This method is checks if a new status update exists (new version was installed,
653
680
* or an update failed) and return its details (version label, status).
@@ -682,29 +709,4 @@ - (void)applicationWillResignActive
682
709
resolve (nil );
683
710
}
684
711
685
- /*
686
- * This method is the native side of the CodePush.restartApp() method.
687
- */
688
- RCT_EXPORT_METHOD (restartApp:(BOOL )onlyIfUpdateIsPending)
689
- {
690
- // If this is an unconditional restart request, or there
691
- // is current pending update, then reload the app.
692
- if (!onlyIfUpdateIsPending || [self isPendingUpdate: nil ]) {
693
- [self loadBundle ];
694
- }
695
- }
696
-
697
- /*
698
- * This method is the native side of the CodePush.downloadAndReplaceCurrentBundle()
699
- * method, which replaces the current bundle with the one downloaded from
700
- * removeBundleUrl. It is only to be used during tests and no-ops if the test
701
- * configuration flag is not set.
702
- */
703
- RCT_EXPORT_METHOD (downloadAndReplaceCurrentBundle:(NSString *)remoteBundleUrl)
704
- {
705
- if ([CodePush isUsingTestConfiguration ]) {
706
- [CodePushPackage downloadAndReplaceCurrentBundle: remoteBundleUrl];
707
- }
708
- }
709
-
710
- @end
712
+ @end
0 commit comments