我曾经有一个UIButton,它将以itms://example.com的形式加载URL,当按下该键时,会在AppStore上(而不是在浏览器中)加载iOS应用程序中的相关项)。

但是,这不再对我有用。如果我将URL切换为https://,则会在浏览器中打开相关页面,但是如果我使用itms或itms-apps,则它什么都不做。是否知道为什么或是否有新的方法?

用例是从一个应用程序引荐人们从AppStore下载另一个。

最佳答案

使用http链接应通过通用链接直接打开到App Store应用程序。

// open Google Earth in the app store
UIApplication.shared.open(URL(string: "http://itunes.apple.com/us/app/google-earth/id293622097?mt=8")!, options: [:], completionHandler: nil)


如果您希望将体验保留在应用程序内部,请使用rmaddy指出的SKStoreProductViewController

关于ios - itms或itms-apps链接不再打开AppStore吗?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/55876165/

10-12 19:44