@@ -378,7 +378,7 @@ - (void)initializeUpdateAfterRestart
378
378
* This method checks to see whether a specific package hash
379
379
* has previously failed installation.
380
380
*/
381
- - (BOOL )isFailedHash : (NSString *)packageHash
381
+ + (BOOL )isFailedHash : (NSString *)packageHash
382
382
{
383
383
NSUserDefaults *preferences = [NSUserDefaults standardUserDefaults ];
384
384
NSMutableArray *failedUpdates = [preferences objectForKey: FailedUpdatesKey];
@@ -408,7 +408,7 @@ - (BOOL)isFailedHash:(NSString*)packageHash
408
408
* represents a downloaded and installed update, that hasn't
409
409
* been applied yet via an app restart.
410
410
*/
411
- - (BOOL )isPendingUpdate : (NSString *)packageHash
411
+ + (BOOL )isPendingUpdate : (NSString *)packageHash
412
412
{
413
413
NSUserDefaults *preferences = [NSUserDefaults standardUserDefaults ];
414
414
NSDictionary *pendingUpdate = [preferences objectForKey: PendingUpdateKey];
@@ -676,7 +676,7 @@ - (void)applicationWillResignActive
676
676
}
677
677
678
678
// We have a CodePush update, so let's see if it's currently in a pending state.
679
- BOOL currentUpdateIsPending = [self isPendingUpdate: [package objectForKey: PackageHashKey]];
679
+ BOOL currentUpdateIsPending = [[ self class ] isPendingUpdate: [package objectForKey: PackageHashKey]];
680
680
681
681
if (updateState == CodePushUpdateStatePending && !currentUpdateIsPending) {
682
682
// The caller wanted a pending update
@@ -715,7 +715,7 @@ - (void)applicationWillResignActive
715
715
{
716
716
NSError *error;
717
717
[CodePushPackage installPackage: updatePackage
718
- removePendingUpdate: [self isPendingUpdate: nil ]
718
+ removePendingUpdate: [[ self class ] isPendingUpdate: nil ]
719
719
error: &error];
720
720
721
721
if (error) {
@@ -758,7 +758,7 @@ - (void)applicationWillResignActive
758
758
resolve:(RCTPromiseResolveBlock)resolve
759
759
reject:(RCTPromiseRejectBlock)reject)
760
760
{
761
- BOOL isFailedHash = [self isFailedHash: packageHash];
761
+ BOOL isFailedHash = [[ self class ] isFailedHash: packageHash];
762
762
resolve (@(isFailedHash));
763
763
}
764
764
@@ -798,7 +798,7 @@ - (void)applicationWillResignActive
798
798
{
799
799
// If this is an unconditional restart request, or there
800
800
// is current pending update, then reload the app.
801
- if (!onlyIfUpdateIsPending || [self isPendingUpdate: nil ]) {
801
+ if (!onlyIfUpdateIsPending || [[ self class ] isPendingUpdate: nil ]) {
802
802
[self loadBundle ];
803
803
resolve (@(YES ));
804
804
return ;
0 commit comments