从iPhone应用程序链接到iTunes歌曲/专辑 [英] Link to an iTunes song / album from iPhone app

查看:157
本文介绍了从iPhone应用程序链接到iTunes歌曲/专辑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作一个乐队的iPhone应用程序,其中列出了乐队的歌曲。当用户触摸歌曲旁边的按钮时,我想打开iTunes并显示该歌曲。目前我正在使用此代码:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:linkLocation]];
其中linkLocation是iTunes中歌曲的链接。这很有效。

I'm making an iPhone app for a band, which lists songs for the band. When the user touches a button next to a song, I want to open iTunes and display that song. Currently I'm using this code: [[UIApplication sharedApplication] openURL:[NSURL URLWithString: linkLocation]]; where linkLocation is a link to the song in iTunes. This works.

我遇到的问题是找到一首歌的链接。我从最新版本的iTunes获得的链接与我之前在以前版本中获得的链接不同(通过单击歌曲旁边的下拉箭头,然后选择复制链接)。如果我使用新版iTunes中的链接,当我尝试通过我的应用程序打开该链接时,我的iPhone上会收到错误您的请求无法完成。

The problem I have is finding the link for a song. The links I get from the latest version of iTunes are different to the links I used to get in the previous version (by clicking on the dropdown arrow next to a song, and choosing "copy link"). If I use the link from the new version of iTunes, I get the error "Your request could not be completed" on my iPhone when I try to open that link through my app.

我也尝试使用AppleitmsLinkMaker网站,这也不起作用。

I've also tried using the Apple "itmsLinkMaker" site, and that doesn't work either.

推荐答案

事实证明,Apple的itmsLinkMaker网站确实有效 - 我一定是在错误地复制链接。

Well it turns out Apple's itmsLinkMaker site does work - I must have been copying the links wrong.

以下链接以防万一其他人来看:
http://ax.phobos.apple.com.edgesuite.net/ WebObjects / MZStoreServices.woa / wa / itmsLinkMaker

Here's the link in case anyone else comes looking: http://ax.phobos.apple.com.edgesuite.net/WebObjects/MZStoreServices.woa/wa/itmsLinkMaker

这篇关于从iPhone应用程序链接到iTunes歌曲/专辑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆