OS如何取得APP的版本信息跟服务器对比进行升级提示?
2014-07-30 15:34
567 查看
关键是自动取版本信息:
[NSString stringWithFormat:@"Version %@",[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"]];
[NSString stringWithFormat:@"Build %@",[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]];
#define APP_DownloadURL @"http://itunes.apple.com/app/id483504146?mt=8" //换成你自己的APP地址
- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex {
if (buttonIndex != [alertView cancelButtonIndex])
{
NSURL *url = [NSURL URLWithString:APP_DownloadURL];
[[UIApplication sharedApplication] openURL:url];
}
}
-(void)alertUpdate:(NSString *)strContent
{
if (!isAlertUpdateShowed) {
isAlertUpdateShowed=YES;
UIAlertView *av = [[[UIAlertView alloc] initWithTitle:@"升级提示"
message:strContent
delegate:self //委托给Self,才会执行上面的调用
cancelButtonTitle:@"以后再说"
otherButtonTitles:@"马上更新",nil]
autorelease];
[av show];
}
}
-(void)checkUpdate
{
NSString* sLastVersion=@"1.1"; //取最新的版本自己去实现
[NSString stringWithFormat:@"Version %@",[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"]];
[NSString stringWithFormat:@"Build %@",[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]];
#define APP_DownloadURL @"http://itunes.apple.com/app/id483504146?mt=8" //换成你自己的APP地址
- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex {
if (buttonIndex != [alertView cancelButtonIndex])
{
NSURL *url = [NSURL URLWithString:APP_DownloadURL];
[[UIApplication sharedApplication] openURL:url];
}
}
-(void)alertUpdate:(NSString *)strContent
{
if (!isAlertUpdateShowed) {
isAlertUpdateShowed=YES;
UIAlertView *av = [[[UIAlertView alloc] initWithTitle:@"升级提示"
message:strContent
delegate:self //委托给Self,才会执行上面的调用
cancelButtonTitle:@"以后再说"
otherButtonTitles:@"马上更新",nil]
autorelease];
[av show];
}
}
-(void)checkUpdate
{
NSString* sLastVersion=@"1.1"; //取最新的版本自己去实现
相关文章推荐
- iOS如何取得APP的版本信息跟服务器对比进行升级提示?
- iOS如何取得APP的版本信息跟服务器对比进行升级提示?
- iOS如何取得APP的版本信息跟服务器对比进行升级提示
- (转)iOS如何取得APP的版本信息跟服务器对比进行升级提示?
- iOS如何取得APP的版本信息跟Apple服务器对比进行升级提示?
- android中如何让自己开发的软件周期性的进行版本升级的提示
- c/s程序版本自动升级的问题,如何判断client端版本号是否最新,然后从指定ftp服务器down
- [Cocos2d-x]在Cocos2d-x 3.x版本中如何通过WebSocket连接服务器进行数据传输
- 取得APP/LIB版本信息的方法
- 如何查看SQL Server的版本、补丁包信息?以及如何鉴别是否需要升级自己的SQL Server?
- 【Android】app打包成apk文件以后,如何查看VersionCode、VersionName等版本信息
- 如何在silverlight application中获取silverlight 版本信息,os信息和browser信息
- Linux下如何查看CPU型号、个数、核数、逻辑CPU数、位数、发行版本、内核信息、内存、服务器生产厂家
- [Cocos2d-x]在Cocos2d-x 3.x版本中如何通过WebSocket连接服务器进行数据传输
- Android 中如何取得已经安装在手机山的app的信息
- 【方正中间件】用平台如何进行连远程服务器开发(.net版本/数据库SQLServer)
- 如何查看服务器机型,如何查看软件的版本信息
- 【方正中间件】用平台如何进行连远程服务器开发(JAVA版本/数据库SQLServer)
- 在Windows Mobile和Wince(Windows Embedded CE)下进行Native C++开发,如何取出资源文件中的版本信息
- 如何获取版本的 Internet 信息服务器 (IIS)