iOS 应用中直接跳转到 AppStore 的方法
程序员文章站
2022-04-12 20:07:49
找到应用程序的描述链接,比如:https://itunes.apple.com/gb/app/yi-dong-cai-bian/id391945719?mt=8
然后将 https:// 替换为 i...
找到应用程序的描述链接,比如:https://itunes.apple.com/gb/app/yi-dong-cai-bian/id391945719?mt=8
然后将
https:// 替换为
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
然后打开这个链接地址:
[[uiapplication sharedapplication] openurl:[nsurl urlwithstring:@"itms://itunes.apple.com/gb/app/yi-dong-cai-bian/id391945719?mt=8"]]; [[uiapplication sharedapplication] openurl:[nsurl urlwithstring:@"itms-apps ://itunes.apple.com/gb/app/yi-dong-cai-bian/id391945719?mt=8"]]; 跳转到应用评价页 nsstring *urlstr = [nsstring stringwithformat:@"itms-apps://itunes.apple.com/webobjects/mzstore.woa/wa/viewcontentsuserreviews?type=purple+software&id=%@&pagenumber=0&sortordering=2&mt=8", appid]; [[uiapplication sharedapplication] openurl:[nsurl urlwithstring:urlstr]]; 跳转到应用详情页 nsstring *urlstr = [nsstring stringwithformat:@"itms-apps://itunes.apple.com/app/id%@", appid]; [[uiapplication sharedapplication] openurl:[nsurl urlwithstring:urlstr]];
这个最好在真机上面测试,在模拟器上测试,会没有效果。