ios - 使用搜索在 App 内启动 iTunes Store

标签 ios iphone xcode itunes storekit

我正在创建一个 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.

http://linkmaker.itunes.apple.com/

关于ios - 使用搜索在 App 内启动 iTunes Store,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32724369/

相关文章:

ios - 更改 UIView 高度和 subview y 位置 [Swift]

ios - 将 NSMutableArray 的内容保存到文件

ios - 按下取消按钮时覆盖 textFieldShouldEndEditing

iphone - iOS - 如何将文本字段提示设置为斜体(使用常规实际文本)?

ios - 扩展委托(delegate)中的调用方法

ios - iOS 9 中定位服务权限提醒

ios - uiwebview 和移动 safari 中内容的区别?

ios - UItableviewcell 在 ios 中返回导航栏可见

java - 移动应用业务逻辑层策略

iphone - 如何通过 App Store 更新使用预填充的核心数据数据库仅更新几个表