iOS开发之获取APP版本号/跳转APPStore(下载页/评论页)

让我们回到项目设置页面,区分一下

Paste_Image.png

代码如下,一般都是写在AppDelegate

//版本号CFBundleShortVersionString不可改

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

//发布版本号CFBundleVersion不可改

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

NSLog(@"内测版本号是%@,发布版本号是%@",shotVersion,appVersion);

下边则是跳转到苹果商店下载页面/评论页面(被不完全遮住的部分是你申请的APPID,你懂的)

Paste_Image.png
//苹果商店下载页面
NSString*str = [NSStringstringWithFormat:@"itms-apps://itunes.apple.com/app/id%d",1024XXXXX];

[[UIApplicationsharedApplication]openURL:[NSURLURLWithString:str]];
Paste_Image.png
//苹果商店评论页面
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]];
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容