iOS应用内跳转到App Store评论界面

项目需求

点击按钮或者一个指定的cell实现跳转到App Store评论界面

步骤

1.获取应用在App Store的链接和Apple ID

此处获取的链接应该是https开头的,以我们公司的App为例(id我做了处理)
https://itunes.apple.com/cn/app/you-xue-you-zhi-nei-rong-ai/idxxxxxxxxxx?mt=8

2.实现跳转到App Store界面

需要将获取到的App Store的链接协议头改成itms-apps

即: https:➡️itms-apps:

1
2
3
4
5
6
7
8
9
NSString *appleID = @"11223317"
NSURL *URL = [NSURL URLWithString:[NSString StringWithFormat:@"itms-apps://itunes.apple.com/cn/app/id%@",appleID]];
[[UIApplication sharedApplication] openURL:url];
```
3.**实现跳转到App Store评论界面**
> 跟上面的代码差不多,只是加了参数
NSString *appleID = @"11223317"
NSURL *URL = [NSURL URLWithString:[NSString StringWithFormat:@"itms-apps://itunes.apple.com/app/viewContentsUserReviews?id=%@",appleID]];
[[UIApplication sharedApplication] openURL:url];

```

这个人很帅<br>他什么都不想说<br>