如何直接从我的应用程序启动Appstore应用程序

Jef*_*eff 26 iphone app-store

我现在使用了几个应用程序直接从应用程序启动itunes商店.我甚至在2.1 iPod 2G上使用了一些.

我知道2.1中有一个错误阻止appstore链接在safari中工作,但不知何故人们直接启动appstore,甚至没有通过safari启动.

你怎么做到这一点?它是一个未记录的openURL功能吗?

Int*_*tss 26

要非常简洁:

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"itms://itunes.com/apps/appname"]];
Run Code Online (Sandbox Code Playgroud)

如果要发送给开发人员的所有应用程序,请使用

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"itms://itunes.com/apps/developername"]];
Run Code Online (Sandbox Code Playgroud)

这些适用于iOS 4.1

另请参阅 如何链接到应用商店中的应用


Ben*_*ieb 19

在iTunes中,将应用程序的图标拖到桌面上,这将为您提供可以直接使用的链接(例如, http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=284036524&mt=8在桌面和iPhone上启动AppStore到Crosswords.

将其弹出到NSURL并在其上调用openURL.

  • 可能相关的问题:http://stackoverflow.com/questions/818973/819064#819064,它为您提供了更好的URL (3认同)

epa*_*tel 16

我想出了如何直接进入AppStore中应用程序的评论页面.

基本上它完成如下,随时阅读我的​​博客文章.

- (IBAction)gotoReviews:(id)sender
{
    NSString *str = @"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa";
    str = [NSString stringWithFormat:@"%@/wa/viewContentsUserReviews?", str]; 
    str = [NSString stringWithFormat:@"%@type=Purple+Software&id=", str];

    // Here is the app id from itunesconnect
    str = [NSString stringWithFormat:@"%@289382458", str]; 

    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
}
Run Code Online (Sandbox Code Playgroud)


Nie*_*ole 6

如果要显示应用程序的详细信息而不是评论,可以使用以下URL:

NSString *appId    = @"app id";
NSString *endPoint = [NSString stringWithFormat:@"phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=%@&mt=8", appId];
NSString *link     = [NSString stringWithFormat:@"itms-apps://%@", endPoint];

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:link]];
Run Code Online (Sandbox Code Playgroud)

我已经在iOS 6.1上使用iOS 6.1对其进行了测试,并会立即将您重定向到App Store应用程序.


Mar*_*rco 5

Ben Gottlieb是对的,但有更快的方法来获取URL:您可以右键单击iTunes中的任何应用程序图标,然后选择"复制iTunes Store URL".

然后打电话UIApplication openURL给它.