我的博客中有详尽的实现过程和相关说明: iOS利用iTunesLookup检查更新 中文介绍
This is a utility class to check version from AppStore.
The preferred way of installtion is via CocoaPods
pod 'AYCheckVersion'
and run pod install
or pod update
. It will install the most recent version of AYCheckVersion.
After that import <AYCheckVersion/AYCheckVersion.h>.
Use AYCheckVersion
AYCheckManager *checkManger = [AYCheckManager sharedCheckManager];
[checkManger checkVersion];
start check version with default param.
- (void)checkVersion;
start check version with AlertTitle,NextTimeTitle,ConfimTitle.
- (void)checkVersionWithAlertTitle:(NSString *)alertTitle nextTimeTitle:(NSString *)nextTimeTitle confimTitle:(NSString *)confimTitle;
start check version with AlertTitle,NextTimeTitle,ConfimTitle,skipVersionTitle.
- (void)checkVersionWithAlertTitle:(NSString *)alertTitle nextTimeTitle:(NSString *)nextTimeTitle confimTitle:(NSString *)confimTitle skipVersionTitle:(NSString *)skipVersionTitle;
If you want open AppStore inside your App, set openAPPStoreInsideAPP
checkManger.openAPPStoreInsideAPP = YES;
If you can't get the update info of your App. Set countryAbbreviation of the sale area. like countryAbbreviation = @"cn"
,countryAbbreviation = @"us"
.General, you don't need to set this property
checkManger.countryAbbreviation = @"cn";
set debugEnable
to print the info in Debug arae
checkManger.debugEnable = YES;
v 1.1.0 fixed bug
v 1.0.1 add debug switch, print the info in Debug arae
v 1.0.0 first version
AYCheckVersion is provided under the MIT license. See LICENSE file for details.
=================
这是一个从AppStore检测最新版本的工具类。
推荐使用CocoaPods进行安装。
pod 'AYCheckVersion'
然后输入 pod install
or pod update
。将会安装最新版本的AYCheckVersion。
最后导入头文件<AYCheckVersion/AYCheckVersion.h>
AYCheckManager *checkManger = [AYCheckManager sharedCheckManager];
[checkManger checkVersion];
使用默认属性进行版本的检测。
- (void)checkVersion;
自定义警示框的标题,下次提示的标题,立即更新的标题。
- (void)checkVersionWithAlertTitle:(NSString *)alertTitle nextTimeTitle:(NSString *)nextTimeTitle confimTitle:(NSString *)confimTitle;
自定义警示框的标题,下次提示的标题,立即更新的标题,跳过该版本的标题。
- (void)checkVersionWithAlertTitle:(NSString *)alertTitle nextTimeTitle:(NSString *)nextTimeTitle confimTitle:(NSString *)confimTitle skipVersionTitle:(NSString *)skipVersionTitle;
如果你想在当前应用中以模态视图的形式打开AppStore,请设置openAPPStoreInsideAPP
,默认从应用跳转出去到AppStore。
checkManger.openAPPStoreInsideAPP = YES;
如果你无法检测到你的App的最新版。请设置你应用的销售地区,如:countryAbbreviation = @"cn"
,countryAbbreviation = @"us"
。通常情况下,你不需要设置这个属性。
checkManger.countryAbbreviation = @"cn";
设置debugEnable
来输出更新信息
checkManger.debugEnable = YES;
v 1.1.0 修复因项目个别version问题导致的bug
v 1.0.1 添加debug开关,输出当前更新信息
v 1.0.0 首次提交
AYCheckVersion 使用 MIT 许可证,详情见 LICENSE 文件。