remove failed updates

This commit is contained in:
Geoffrey Goh
2015-12-22 13:21:43 -08:00
parent 78fe9391af
commit 077e9f47e7
2 changed files with 18 additions and 0 deletions

View File

@@ -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.