ios - itms 或 itms-apps 链接不再打开 AppStore?
问题描述
我曾经有一个UIButton
会以itms://example.comURL
的形式加载一个,当按下它时会在应用程序中加载相关项目(而不是在浏览器中)。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)
如果您希望将体验保留在您的应用程序中,请按照rmaddySKStoreProductViewController
指出的方式使用
推荐阅读
- python - 如何使用远程 Firefox webdriver 下载文件?
- azure - 如何故意死信一条消息是 azure functions v2
- c# - 为什么 EF Core 不允许我创建没有主键的属性?
- r - 在 glm() 函数中编辑“术语”对象
- sql-server - 报表生成器:如何在文本框之间有统一的水平间隙?
- elasticsearch - Solr eDismax Lucene 查询问题
- r - 在 R 中解释奇怪的 Bland-Altman 情节
- python - 如何使用另一个脚本在不同目录中执行一个 python 脚本?
- javascript - 不考虑整个 dom 的 querySelector
- architecture - 干净的独立架构