appstore 评分跳转 详情等

在创建并存储 App 的 iTunes Connect 中可以查看到App对应的Apple ID ,然后在工程里用一个宏定义来全局使用APPID。

#defineAPPID @"Apple ID"

A. 跳转到应用详情页

//1、cn代表中国。在Safari浏览器打开链接是中文介绍NSString*urlStr = [NSStringstringWithFormat:@"https://itunes.apple.com/cn/app/id%@", APPID];

//2、us代表美国。在Safari浏览器打开链接是英文介绍NSString*urlStr = [NSStringstringWithFormat:@"https://itunes.apple.com/us/app/id%@", APPID];

//3、和1跳转相同NSString*urlStr = [NSStringstringWithFormat:@"https://itunes.apple.com/cn/app/apple-store/id%@", APPID];

//4、和2跳转相同NSString*urlStr = [NSStringstringWithFormat:@"https://itunes.apple.com/app/id%@", APPID];

//5、以 itms-apps:// 或 https:// 开头的应用详情页链接,跳转到AppStoreNSString*urlStr = [NSStringstringWithFormat:@"itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=%@", APPID];

//6、以 itms:// 开头的应用详情页连接,会跳转到 iTunes Store,打开的仍然是应用的下载页NSString*urlStr = [NSStringstringWithFormat:@"itms://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=%@", APPID];

//打开链接地址[[UIApplicationsharedApplication] openURL:[NSURLURLWithString:urlStr]];

结论:

跳转到应用详情页

以 itms-apps:// 或 https:// 开头的应用详情页链接,跳转到AppStore。

以 itms:// 开头的应用详情页连接,会跳转到 iTunes Store,打开的仍然是应用的下载页。

推荐:

方法1、3、5。

18.12.29更新:

因为之前开发的APP,我们发布的时候在iTunes Connect 中 APP 销售地区只选择了中国,所以方法1、3中链接地址中带有cn,因此可以在中国地区的App Store中看到我们的上线成功的APP。假如APP销售地区选择了全球很多国家和地区呢?怎么给一个统一的链接地址呢?

我们可以这样:

//7、https:// 开头NSString*urlStr = [NSStringstringWithFormat:@"https://itunes.apple.com/app/id%@", APPID];//8、itms-apps:// 开头NSString*urlStr = [NSStringstringWithFormat:@"itms-apps://itunes.apple.com/app/id%@", APPID];//打开链接地址[[UIApplicationsharedApplication] openURL:[NSURLURLWithString:urlStr]];

B. 跳转到应用评分页

//1、itms-apps:// 开头NSString*urlStr = [NSStringstringWithFormat:@"itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=%@",APPID];//2、itms:// 开头NSString*urlStr = [NSStringstringWithFormat:@"itms://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=%@",APPID];//3、itms-apps:// 开头NSString*urlStr = [NSStringstringWithFormat:@"itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=%@&pageNumber=0&sortOrdering=2&mt=8", APPID];//4、https:// 开头 此时的链接不可以,打开之后就跳转到iPhone自带的【音乐】APP里面了。NSString*urlStr = [NSStringstringWithFormat:@"https://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&onlyLatestVersion=true&pageNumber=0&sortOrdering=1&id=%@",APPID];//打开链接地址[[UIApplicationsharedApplication] openURL:[NSURLURLWithString:urlStr]];

结论:

跳转到应用评分页

以 itms-apps://和itms://开头的链接都可以跳转到AppStore。但是以https:// 开头的链接不可以。

推荐:

方法1、2、3。

C. 总结

其中参数mt:8的含义为:

mt 代表 meta-type,有效值如下:

1 Music

2 Podcasts

3 Audiobooks

4 TV Shows

5 Music Videos

6 Movies

7 iPod Games

8 Mobile Software Applications

9 Ringtones

10 iTunes U

11 E-Books

12 Desktop Apps

https:// 相比较于 itms:// 或者 itms-apps:// 的区别在哪里呢?

itms-apps请求:

iOS系统中可以从应用内或通过Safari跳转App商店;

OS X系统中无法通过浏览器跳转;

https请求:

iOS系统中可以通过大部分浏览器跳转App商店;

OS X系统中可以通过浏览器跳转iTunes商店;

以上示例皆是在真机上面测试得到的结果。

作者:绚雨蓝了个枫

链接:https://www.jianshu.com/p/010ba9153926

来源:

著作权归作者所有,任何形式的转载都请联系作者获得授权并注明出处。

你可能感兴趣的:(appstore 评分跳转 详情等)