rn 跳转评分

2019-11-07  本文已影响0人  米开朗骑騾

最近突然发现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

上一篇下一篇

猜你喜欢

热点阅读