我正在尝试创建指向 App Store 的链接,我找到了很多方法。
let url = URL(string: "itms://itunes.apple.com/th/app/cafe-amazon-smart-pay/id1047593542")
let url = URL(string: "https://itunes.apple.com/th/app/cafe-amazon-smart-pay/id1047593542")
let url = URL(string: "itms-apps://itunes.apple.com/th/app/cafe-amazon-smart-pay/id1047593542?mt=8")
据我所知,方法#2 和#3 几乎产生相同的结果。
但我很好奇它应该有一些区别吗?。
最佳答案
如果您使用此链接 itms-app://
它将直接在商店中打开应用程序。
let url = URL(string: "itms://itunes.apple.com/th/app/cafe-amazon-smart-pay/id1047593542")
您已使用此链接
https://
它将打开通过 Safari 启动 iTunes 的链接。var iTunesLink = "https://itunes.apple.com/th/app/cafe-amazon-smart-pay/id1047593542"
UIApplication.shared.openURL(URL(string: iTunesLink)!)
关于ios - itms-app ://and https://App Store link 有什么区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47348083/