在 iOS 应用中直接跳转到 AppStore 的方法

来源:互联网 发布:程序员兼职的平台 编辑:程序博客网 时间:2024/05/22 00:36

找到应用程序的描述链接,比如:https://itunes.apple.com/cn/app/zhong-guo-lian-tong-shou-ji/id416457422?mt=8”

找APP链接的方法:打开iTunes,在App Store中搜app,在搜到的APP图标下方点击“获取”右边的下拉箭头,获取链接。

然后将 http:// 替换为 itms:// 或者 itms-apps://:

itms://协议将在itunes中找到APP

itms-apps://协议将在App Store中找到APP

itms://itunes.apple.com/cn/app/zhong-guo-lian-tong-shou-ji/id416457422?mt=8”
itms-apps://itunes.apple.com/cn/app/zhong-guo-lian-tong-shou-ji/id416457422?mt=8”
然后打开这个链接地址:

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"itms://itunes.apple.com/cn/app/zhong-guo-lian-tong-shou-ji/id416457422?mt=8"]];

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"itms-apps ://itunes.apple.com/cn/app/zhong-guo-lian-tong-shou-ji/id416457422?mt=8"]];

这个最好在真机上面测试,在模拟器上测试,会没有效果。

0 0
原创粉丝点击