因爲蘋果作了自動升級,全部只要在應用程序中出現從AppStore檢查版本更新,或者出現任何有關升級的提醒都會被拒,可是若是必須添加升級提示的話,能夠配合後臺經過添加API的方式來作,就是版本信息存儲在服務器,應用只須要請求數據,拿到數據版本而後和當前的版本比較就能夠了,因爲是從服務器拿數據,因此在審覈期間,讓後臺控制版本,不提示升級問題,審覈經過以後,更改服務器版本到最新版就能夠了。服務器
跳轉到appstore 以下:app
[[UIApplication sharedApplication]openURL:[NSURL URLWithString:@"itms-apps://itunes.apple.com/cn/app/id1288515707"]];
//拿服務器的版本與當前的比較
// 獲取當前版本 -(NSString *)version { NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary]; NSString *app_Version = [infoDictionary objectForKey:@"CFBundleShortVersionString"]; return app_Version; }
登陸蘋果開發者帳號 --> 登陸帳號--> 點擊iTunes Connect --> go to iTunes Connect --> My App (個人App) --> 點擊App Store 欄下的 APP 信息 --> 向下滑會看到 Apple ID 這個就是跳轉到應用程序須要的id
NSString *url = [[NSString alloc] initWithFormat:@"http://itunes.apple.com/lookup?id=%@",id]; // id就是線上產品的ID 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){ receiveStatusDic=[[NSMutableDictionary alloc]init]; if (data) { NSDictionary *receiveDic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil]; NSLog(@"receiveDic is %@",receiveDic); //字典receiveDic中就包含版本信息 }
信息入下
{ resultCount = 1; receiveDic = ( { artistId = 開發者 ID; artistName = 開發者名稱; price = 0; isGameCenterEnabled = 0; kind = software; languageCodesISO2A = ( EN ); trackCensoredName = 審查名稱; trackContentRating = 評級; trackId = 應用程序 ID; trackName = 應用程序名稱"; trackViewUrl = 應用程序介紹網址; userRatingCount = 用戶評級; userRatingCountForCurrentVersion = 1; version = 版本號; wrapperType = software; } ); }