菜鸟教程小白 发表于 2022-12-13 11:03:50

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


                                            <p><p>我正在创建一个 iOS 广播电台应用,但我找不到解决我认为是一个简单问题的方法。如果我的电台播放人们想要购买的歌曲/专辑,<strong>我如何才能启动 iTunes Store 并打开它并显示该轨道或专辑的搜索结果?</strong></p>

<p>我知道我可以使用 Apple Search API 获取搜索结果的 json 并解析它以获得最佳搜索结果,并且我知道我可以使用 <a href="https://itunes.apple.com/" rel="noreferrer noopener nofollow">https://itunes.apple.com/</a> 打开 iTunes 商店(如果我尝试将搜索字符串附加到此,我会返回元数据)或者如果我知道产品 ID,则使用 SKStoreProductViewController。</p>

<p><strong>但是有没有一种方法可以简单地打开 iTunes Store 以打开歌曲或专辑(或两者)的搜索结果,而无需评估搜索元数据并将它们发送到一个(可能是错误的)产品?</strong></p>

<p>谢谢!</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>您可以使用 URL Scheme 和一个名为 iTunes Link Maker 的工具来完成此操作。可在 Apple 网站 <a href="https://developer.apple.com/library/ios/featuredarticles/iPhoneURLScheme_Reference/iTunesLinks/iTunesLinks.html#//apple_ref/doc/uid/TP40007899-CH3-SW1" rel="noreferrer noopener nofollow">here</a> 上找到 iTunes 的文档。 </p>

<blockquote>
<p>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.</p>
</blockquote>

<p> <a href="http://linkmaker.itunes.apple.com/" rel="noreferrer noopener nofollow">http://linkmaker.itunes.apple.com/</a> </p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - 使用搜索在 App 内启动 iTunes Store,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/32724369/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/32724369/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - 使用搜索在 App 内启动 iTunes Store