获取appstore版本号,本机app版本号,以及跳转appstore整理
2016-09-06 00:00
459 查看
#pragma mark -- 获取appstore版本号 -(void)Postpath:(NSString *)path { NSString *url = [[NSString alloc] initWithFormat:@"http://itunes.apple.com/lookup?id=%@",@"414478124"]; NSURL *url = [NSURL URLWithString:path]; NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:10]; [request setHTTPMethod:@"POST"]; NSOperationQueue *queue = [NSOperationQueue new]; [NSURLConnection sendAsynchronousRequest:request queue:queue completionHandler:^(NSURLResponse *response,NSData *data,NSError *error){ NSMutableDictionary *receiveStatusDic=[[NSMutableDictionary alloc]init]; if (data) { NSDictionary *receiveDic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil]; if ([[receiveDic valueForKey:@"resultCount"] intValue]>0) { [receiveStatusDic setValue:@"1" forKey:@"status"]; [receiveStatusDic setValue:[[[receiveDic valueForKey:@"results"] objectAtIndex:0] valueForKey:@"version"] forKey:@"version"]; }else{ [receiveStatusDic setValue:@"-1" forKey:@"status"]; } }else{ [receiveStatusDic setValue:@"-1" forKey:@"status"]; } [self performSelectorOnMainThread:@selector(receiveData:) withObject:receiveStatusDic waitUntilDone:NO]; }]; } -(void)receiveData:(id)sender { NSLog(@"receiveData=%@",sender); //打印获取到的版本号 } #pragma mark -- //获取本地版本号 //获取本地版本号 NSString* thisVersion = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"]; 3.跳转到AppStore下载 //APPid需要填写自己app的id NSString *urlStr = [NSString stringWithFormat:@"itms-apps://itunes.apple.com/app/id%@",APPID]; NSURL *url = [NSURLURLWithString:urlStr]; [[UIApplication sharedApplication]openURL:url];
相关文章推荐
- ios开发之 获取APP版本号/跳转APPStore(下载页/评论页)
- swift之获取APP各种参数和device参数、获取APPstore信息、以及跳转到appstore
- ios开发之 获取APP版本号/跳转APPStore(下载页/评论页)
- iOS开发之获取APP在AppStore中的版本号
- IOS 获取IOS屏幕尺寸大小以及 获取当前app的名称和版本号
- iOS开发之app之间的跳转以及跳转到appstore
- iOS应用内跳转至App Store 以及获取App Store内最新版本号
- app升级,获取AppStore版本号和本地版本号
- iOS开发之app之间的跳转以及跳转到appstore
- 获取当前手机App版本以及AppStore中的最新版本,判断是否需要更新
- iOS计算App缓存的大小以及清理、iOS应用跳转到appstore评分、文字加阴影、 NSMutableArray到NSData的转化
- IOS--OC获取app应用版本的信息和当前设备的各种信息,跳转到appstore(二)
- APP升级,获取AppStore版本号和本地版本号--Swift
- iOS 获取appStore的链接地址,从app中跳转 appStore中应用
- Android获取手机型号,系统版本,App版本号等信息
- 获取AppStore上架后的应用版本号
- Android获取手机型号,系统版本,App版本号等信息
- iphone开发--获取当前app的版本号
- 【hta版】获取AppStore上架后的应用版本号