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

1.找到应用程序的App Store链接,比如:http://itunes.apple.com/gb/app/yi-dong-cai-bian/id391945719?mt=8

打开iTunes ——>找到对应的软件——>右键(拷贝链接)


在 iOS 应用中直接跳转到 AppStore 的方法_第1张图片

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

itms://itunes.apple.com/gb/app/yi-dong-cai-bian/id391945719?mt=8

itms-apps://itunes.apple.com/gb/app/yi-dong-cai-bian/id391945719?mt=8

3.然后打开这个链接地址:

[[UIApplicationsharedApplication]openURL:[NSURLURLWithString:@"itms://itunes.apple.com/gb/app/yi-dong-cai-bian/id391945719?mt=8"]];

[[UIApplicationsharedApplication]openURL:[NSURLURLWithString:@"itms-apps://itunes.apple.com/gb/app/yi-dong-cai-bian/id391945719?mt=8"]];

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

4.重要的事情

如果app的链接地址为:https://itunes.apple.com/cn/app/马上颂快递员/id1117670028?mt=8

其中的“马上颂快递员”必须转换为英文字母,否则不能跳转(英文字母随意)。

你可能感兴趣的:(在 iOS 应用中直接跳转到 AppStore 的方法)