iOS 11更新后,以往跳转评论区方法并不好用.在查询一些资料后做了下适配,代码如下:
// 跳转App Store评论区
- (void)jumpAppStoreRatings
{
NSString *ratingsUrl = [NSString string];
if (@available(iOS 11, *))
{
// iOS 11以后跳转方法
ratingsUrl = @"itms-apps://itunes.apple.com/cn/app/id此处填写APPID?mt=8&action=write-review";
}
else
{
// iOS 11跳转方法
ratingsUrl = @"https://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=此处填写APPID&pageNumber=0&sortOrdering=2&type=Purple+Software&mt=8";
}
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:ratingsUrl]];
}
注意替换自己的APPID.
网友评论