检查您的AppStore中是否有更新的应用版本,并提示用户更新。
一行代码
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[[ATAppUpdater sharedUpdater] showUpdateWithForce];
return YES;
}- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[[ATAppUpdater sharedUpdater] showUpdateWithConfirmation];
return YES;
}自定义标题 + 本地化
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
ATAppUpdater *updater = [ATAppUpdater sharedUpdater];
[updater setAlertTitle:NSLocalizedString(@"Nuwe Weergawe", @"Alert Title")];
[updater setAlertMessage:NSLocalizedString(@"Weergawe %@ is beskikbaar op die AppStore.", @"Alert Message")];
[updater setAlertUpdateButtonTitle:@"Opgradeer"];
[updater setAlertCancelButtonTitle:@"Nie nou nie"];
[updater setDelegate:self]; // Optional
[updater showUpdateWithConfirmation];
return YES;
}支持委托方法
- (void)appUpdaterDidShowUpdateDialog;
- (void)appUpdaterUserDidLaunchAppStore;
- (void)appUpdaterUserDidCancel;手动
ATAppUpdater文件夹复制到您的项目中SystemConfiguration.framework#import "ATAppUpdater.h"在所需的类中<ATAppUpdaterDelegate>协议CocoaPods
pod 'ATAppUpdater'#import "ATAppUpdater.h"在所需的类中<ATAppUpdaterDelegate>协议ATAppUpdater遵循MIT许可证发布。有关详细信息,请参阅LICENSE