我正在创建一个 iOS 广播电台应用程序,但我找不到解决我认为是一个简单问题的方法。如果我的电台播放人们想要购买的歌曲/专辑,我怎样才能启动 iTunes Store 并打开它并显示该轨道或专辑的搜索结果?
我知道我可以使用 Apple Search API 获取搜索结果的 json 并对其进行解析以获得最佳搜索结果,而且我知道我可以使用 https://itunes.apple.com/ 打开 iTunes 商店(如果我尝试向其附加搜索字符串,我会取回元数据)或者如果我知道产品 ID,则使用 SKStoreProductViewController。
但是有没有一种方法可以简单地打开 iTunes Store 以打开歌曲或专辑(或两者)的搜索结果,而无需评估搜索元数据并将它们发送到一个(可能是错误的)产品?强>
谢谢!
最佳答案
您可以使用 URL Scheme 和名为 iTunes Link Maker 的工具来完成此操作。可以在 Apple 网站上找到 iTunes 的文档 here
The iTunes URL scheme is used to link to content on the iTunes Music Store. The iTunes URL format is complicated to construct, so you create it using an online tool called iTunes Link Maker. The tool allows you to select a country destination and media type, and then search by song, album, or artist. After you select the item you want to link to, it generates the corresponding URL.
关于ios - 使用搜索在 App 内启动 iTunes Store,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32724369/