Remind the user to update the application when a new version is available.
Check Version
TYUpdatePrompt *updatePrompt = [TYUpdatePrompt sharedInstance];
[updatePrompt checkVersionWithCompletionHandler:^(BOOL isNeedUpdate, NSString *appName, TYUPAppStoreInfo *appStoreInfo) {
if (isNeedUpdate) {
NSString *title = @"Update Available";
NSString *message = [NSString stringWithFormat:@"A new version of %@ is available. Please update to version %@ now.\n\nRelease Notes\n\n%@",
appName,
appStoreInfo.version,
appStoreInfo.releaseNotes];
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:title
message:message
delegate:self
cancelButtonTitle:nil
otherButtonTitles:@"Update", @"Next time", nil];
[alertView show];
}
}];
Check Version Daily
TYUpdatePrompt *updatePrompt = [TYUpdatePrompt sharedInstance];
[updatePrompt checkVersionDailyWithCompletionHandler:^(BOOL isNeedUpdate, NSString *appName, TYUPAppStoreInfo *appStoreInfo) {
...
}];
Check Version Weekly
TYUpdatePrompt *updatePrompt = [TYUpdatePrompt sharedInstance];
[updatePrompt checkVersionWeeklyWithCompletionHandler:^(BOOL isNeedUpdate, NSString *appName, TYUPAppStoreInfo *appStoreInfo) {
...
}];
To run the example project, clone the repo, and run pod install
from the Example directory first.
TYUpdatePrompt is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "TYUpdatePrompt"
TYUpdatePrompt is available under the MIT license. See the LICENSE file for more info.