插入"从iTunes下载"按钮的应用程序 [英] Insert "Download on iTunes" button in app

查看:164
本文介绍了插入"从iTunes下载"按钮的应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序显示某首歌曲的标题,我想插​​入iTunes下载按钮,打开iTunes的在我的iPhone指向我的歌。
我检索了正确的iTunes网址,使用的 iTunes的链接设备
但我有两个问题给你。

My app shows the title of a certain song and I would like to insert a "Download on iTunes" button that open iTunes on my iPhone pointing to my song. I've retrieved the correct iTunes url, using the iTunes Link Maker but I've two questions for you.


  • 在哪种方式我可以将此按钮添加到我的UIView?我一定要插入一个标准的按钮?我有哪些方法来调用?

  • 是否有可能动态组成iTunes网址?

我试图实现以下方法:

- (void) openItunes
{
    NSString *iTunesLink = selectedAlbum.itunesLink;
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:iTunesLink]];
}

iTunesLink ITMS://itunes.apple.com/it/album / ... 。如果我推出这个网址的Safari,iTunes会自动打开专注于正确的歌曲。但是,如果我调用 openItunes 方法从模拟器或iPad的触摸没有反应。
任何想法?

with iTunesLink like itms://itunes.apple.com/it/album/.... If I launch this url with Safari, iTunes is automatically opened focusing on the right song. But if I invoke the openItunes method from simulator or iPad Touch nothing happens. Any ideas?

问候,yassa

推荐答案

最后这个工作对我来说:

Finally this worked for me:

- (IBAction)buyAlbum:(id)sender
{
    NSString* url = @"itms://itunes.apple.com/it/album/love-life-lamore-e-la-vita/id298792107?uo=4";

    [[UIApplication sharedApplication] openURL: [NSURL URLWithString: url ]];
}

yassa

这篇关于插入"从iTunes下载"按钮的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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