rn 跳转评分

最近突然发现APP内给应用评分功能跳转到App Store之后提示“无法连接到App Store”,研究之后发现是iOS 11系统的适配问题,这里记录下解决方法。

iOS 11以前你的跳转App Store评分代码可能这样写的:

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=xxxxxx&pageNumber=0&sortOrdering=2&type=Purple+Software&mt=8"]];
iOS 11之后要改为:

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"itms-apps://itunes.apple.com/cn/app/idxxxxxx?mt=8&action=write-review"]];
为了适配,所以:

if (@available(iOS 11.0, *)) {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"itms-apps://itunes.apple.com/cn/app/idxxxxxx?mt=8&action=write-review"]];
}else{
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=xxxxxx&pageNumber=0&sortOrdering=2&type=Purple+Software&mt=8"]];
}

https://blog.csdn.net/txz_gray/article/details/81364107
https://www.jianshu.com/p/010ba9153926

https://blog.csdn.net/qq_24702189/article/details/79345362

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容