美文网首页
iOS 客户端提示更新版本

iOS 客户端提示更新版本

作者: 梦iOS | 来源:发表于2016-11-15 15:08 被阅读0次

//获取本地版本

NSDictionary*infoDic = [[NSBundlemainBundle]infoDictionary];

NSString*currentVersion = [infoDicobjectForKey:@"CFBundleShortVersionString"];

//获取商店版本

NSString*URL =APP_URL;//app在商店的链接:https://itunes.apple.com/lookup?id=11587617

AFHTTPSessionManager*ss = [AFHTTPSessionManagermanager];

[ssGET:URLparameters:nilprogress:nilsuccess:^(NSURLSessionDataTask*_Nonnulltask,id_NullableresponseObject) {

_appStoreVersion = [responseObjectobjectForKey:@"results"];

//NSLog(@"------%@",_appStoreVersion);

//NSLog(@"---------%@",_appStoreVersion);

//NSLog(@"版本:%@",[_appStoreVersion[0] objectForKey:@"version"]);

if([currentVersion isEqualToString:[_appStoreVersion[0]   objectForKey:@"version"]]) {

NSLog(@"最新版");

}else{

//[self alertUpVersionView];

}

;

}failure:^(NSURLSessionDataTask*_Nullabletask,NSError*_Nonnullerror) {

NSLog(@"%@",error);

}];

#pragma弹出更新弹框

-(void)alertUpVersionView{

UIAlertController*alertController = [UIAlertControlleralertControllerWithTitle:@"检测到新版本"message:@"是否前往商店更新"

preferredStyle:UIAlertControllerStyleAlert];

UIAlertAction*sureAction = [UIAlertActionactionWithTitle:@"确定"style:UIAlertActionStyleDestructivehandler:^(UIAlertAction*_Nonnullaction) {

[[UIApplication sharedApplication]openURL:[NSURLURLWithString:@"https://itunes.apple.com/us/app/gong-wu-yong-che/id1158761757?mt=8"]];

}];

[alertController addAction:sureAction];

[self presentViewController:alertControlleranimated:YES completion:nil];

}

相关文章

  • 上架APP进行版本升级检测

    文章来源:iOS-App版本更新提示AppDelegate.m文件: 提示更新的界面增加:

  • iOS版本更新提示

    iOS更新提示比较简单,不需要后台记录版本号,直接去App Store获取最新版本即可。

  • iOS 版本更新提示

    项目需求:由于公司项目是做离线地图的,老板希望有版本更新时用户能及时更新,所以要求app第一次检测到版本更新时记录...

  • ios 版本更新提示

    苹果审核中如果发现项目中有版本更新提示,将禁止上架,那么我们可以让后台传一个字段,上架前后修改一下即可,或者通过下...

  • iOS版本更新提示

    检测线上是否有新版本发布

  • APP更新提示以及强制更新

    接口参数 客户端处理 对比版本号:当本地版本号低于后台返回的版本号时,显示更新提示; 判断更新类型,是强制更新还是...

  • 微信现在的一小步,未来的一大步

    近日,iOS 微信客户端从 6.5.7 版本更新至 6.5.8 版本,虽然看似小版本更新,但是我们却可以从中一窥微...

  • iOS应用提示版本更新

    今天看到cocoachina上一个检查应用版本更新的demo 自己又用swift写了一遍,主要是看这个的实现原理是...

  • iOS 客户端提示更新版本

    //获取本地版本NSDictionary*infoDic = [[NSBundlemainBundle]infoD...

  • 无标题文章

    //提示版本更新 [self VersonUpdate]; #pragma mark ------提示用户版本更新...

网友评论

      本文标题:iOS 客户端提示更新版本

      本文链接:https://www.haomeiwen.com/subject/mjyeuttx.html