首页 > 解决方案 > itms 或 itms-apps 链接不再打开 AppStore?

问题描述

我曾经有一个UIButton会以itms://example.comURL的形式加载一个,当按下它时会在应用程序中加载相关项目(而不是在浏览器中)。AppStoreiOS

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

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

标签: iosswift

解决方案


使用 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)

如果您希望将体验保留在您的应用程序中,请按照rmaddySKStoreProductViewController指出的方式使用


推荐阅读