ios開發之 獲取APP版本號/跳轉APPStore(下載頁/評論頁)

讓咱們回到項目設置頁面,區分一下 
這裏寫圖片描述 
代碼以下,通常都是寫在AppDelegate 
這裏寫圖片描述app

//版本號CFBundleShortVersionString不可改

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

//發佈版本號CFBundleVersion不可改

NSString*appVersion = [infoDicobjectForKey:@"CFBundleVersion"];

NSLog(@"內測版本號是%@,發佈版本號是%@",shotVersion,appVersion);
  • 跳轉到蘋果商店下載頁面 

蘋果APP下載頁面

NSString*str = [NSStringstringWithFormat:@"itms-apps://itunes.apple.com/app/id%d",1024XXXXX];

[[UIApplicationsharedApplication]openURL:[NSURLURLWithString:str]];
  • 跳轉到蘋果商店評論頁面 

蘋果APP評論頁面

NSString*str = [NSStringstringWithFormat:

@"http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=%d&pageNumber=0&sortOrdering=2&type=Purple+Software&mt=8",1024XXX];

[[UIApplicationsharedApplication]openURL:[NSURLURLWithString:str]];
相關文章
相關標籤/搜索