美文网首页
iOS 11跳转App Store评论

iOS 11跳转App Store评论

作者: ROFL | 来源:发表于2017-10-13 17:30 被阅读9次

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.

相关文章

网友评论

      本文标题:iOS 11跳转App Store评论

      本文链接:https://www.haomeiwen.com/subject/jqttuxtx.html