简体   繁体   English

如何从iPhone应用程序链接到iTunes商店?

[英]How to link to the iTunes store from iPhone app?

I am trying to set up an application in which users will be able to stream music . 我正在尝试建立一个用户可以在其中播放音乐的应用程序。 When the user is streaming a MP3, I'd like to set up a link to the iTunes store to buy the MP3. 当用户流式传输MP3时,我想建立一个指向iTunes商店的链接以购买MP3。

How can I do that? 我怎样才能做到这一点? I feel like there should be some simple way of doing so using the song title and artist name, am I mistaking? 我觉得应该使用一些简单的方法来使用歌曲名称和歌手姓名,我误会了吗?

Thanks 谢谢

You can experiment with the iTMS Link Maker that Apple provides and see how the links are formed. 您可以尝试使用Apple提供的iTMS Link Maker并查看链接的形成方式。 In addition, here is the iTMS Link Maker FAQ . 此外, 这是iTMS Link Maker常见问题解答

See this blog post about how to query the iTMS Link Maker automatically. 请参阅此博客文章,了解如何自动查询iTMS Link Maker。 Basically, you can query the iTMS Link Maker and get an XML document back that your application can process. 基本上,您可以查询iTMS Link Maker并获取应用程序可以处理的XML文档。

The iTunes Store Web Service Search API (pdf), although old and incomplete, documents how to search for content in the iTunes store and returns a JSON string with results. iTunes Store Web服务搜索API (pdf)尽管过时且不完整,但它说明了如何在iTunes Store中搜索内容并返回带有结果的JSON字符串。

The iTunes Store Web Service Search API allows you to place search fields in your website to search for content within the iTunes Store. iTunes Store Web服务搜索API允许您在网站中放置搜索字段,以在iTunes Store中搜索内容。 You can search for a variety of iTunes Store content; 您可以搜索各种iTunes Store内容。 including movies, podcasts, music, music videos, audiobooks, and TV shows. 包括电影,播客,音乐,音乐视频,有声读物和电视节目。 You can also call an ID-based lookup request to create mappings between your content library and the iTunes Store content library. 您还可以调用基于ID的查找请求,以在内容库和iTunes Store内容库之间创建映射。

Queries are sent to base url: 查询将发送到基本URL:

http://ax.phobos.apple.com.edgesuite.net/WebObjects/MZStoreServices.woa/wa/wsSearch?parameterkeyvalue

Where parameterkeyvalue can be one or more parameter key and value pairs indicating the details of your query. 其中parameterkeyvalue可以是一个或多个参数键和值对,表示查询的详细信息。

Ok, I had this same problem and the answers here did not give me enough info. 好的,我有同样的问题,这里的答案没有给我足够的信息。 So I asked this question again with different wording, and continued to search for an answer. 因此,我再次用不同的措词问了这个问题,并继续寻找答案。 I ended up answering my own question in the other question, and have posted the code to do this over there. 我最终在另一个问题中回答了自己的问题,并在此处发布了执行此操作的代码。

You can find the question at: 您可以在以下位置找到问题:

Opening iTunes Store to specific song 在iTunes Store中打开特定歌曲

It contains all the code you will need to open the iTunes Store to the specific song specified by song name and song artist. 它包含打开iTunes Store到歌曲名和歌曲艺术家指定的特定歌曲所需的所有代码。

I hope this helps someone. 我希望这可以帮助别人。

Creating a link to the app store could be very problematic. 创建到应用商店的链接可能会非常麻烦。 I suggest you use a simple library called iLink that I found when searching for a solution for this exact issue. 我建议您使用一个名为iLink的简单库,该库是在搜索此确切问题的解决方案时找到的。 It would figure out everything and create the link you need that would work always. 它将找出所有内容并创建您需要的链接,该链接将始终有效。 Another great thing is that it is super easy to use. 另一个伟大的事情是它超级易于使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM