mirror of
https://github.com/zhigang1992/react-native-code-push.git
synced 2026-06-10 23:59:42 +08:00
remove failed updates
This commit is contained in:
12
CodePush.m
12
CodePush.m
@@ -109,6 +109,7 @@ static NSString *const PackageIsPendingKey = @"isPending";
|
||||
{
|
||||
[CodePushPackage clearUpdates];
|
||||
[self removePendingUpdate];
|
||||
[self removeFailedUpdates];
|
||||
}
|
||||
|
||||
|
||||
@@ -270,6 +271,17 @@ static NSString *const PackageIsPendingKey = @"isPending";
|
||||
[preferences synchronize];
|
||||
}
|
||||
|
||||
/*
|
||||
* This method is used to clear away failed updates in the event that
|
||||
* a new app store binary is installed.
|
||||
*/
|
||||
+ (void)removeFailedUpdates
|
||||
{
|
||||
NSUserDefaults *preferences = [NSUserDefaults standardUserDefaults];
|
||||
[preferences removeObjectForKey:FailedUpdatesKey];
|
||||
[preferences synchronize];
|
||||
}
|
||||
|
||||
/*
|
||||
* This method is used to register the fact that a pending
|
||||
* update succeeded and therefore can be removed.
|
||||
|
||||
Reference in New Issue
Block a user