这是一个用于查询应用商店中的应用新版本的简单基于块(block)的库。该库会跟踪新版本,并记住它们首次被发现的时间。在检查新版本之前,该库使用可到达性(reachability)来确保网络连接。
pod 'RMAppStoreVersionCheck', '~> 1.0'
self.versionCheck = [[RMAppStoreVersionCheck alloc] init];
[self.versionCheck checkAppStoreVersionForBundleID:@"your.bundle.id" completion:^(RMAppVersionInformation *versionInfo, NSError *error) {
if (versionInfo) {
if (versionInfo.newVersionAvailable && versionInfo.isNewDiscovery) {
NSLog(@"New app version available");
}
}
else if (error){
NSLog(@"Error checking for new version: %@", error);
}
}];