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]];
相关文章
相关标签/搜索