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

时间:2022-02-27 20:46:54

I've used several apps now that launch the itunes store directly from the app. I'm even using some on my 2.1 iPod 2G.

我已经使用了几个应用程序,直接从应用程序启动itunes商店,我甚至在我的2.1 iPod 2G中使用了一些。

I know there's a bug in 2.1 that prevents appstore links from working in safari, but somehow people are launching the appstore directly, not even through safari.

我知道在2.1中有一个bug,可以防止appstore链接在safari中工作,但是不知为什么人们直接启动appstore,甚至不是通过safari。

How do you do this? Is it an undocumented openURL feature?

你是怎么做到的?它是一个未文档化的openURL特性吗?

11 个解决方案

#1


19  

From iTunes, drag the icon of your app to the desktop, this will give you a link you can use directly (for example, http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=284036524&mt=8 launches the AppStore to Crosswords, both on a desktop and an iPhone).

从iTunes,把你的应用程序的图标拖到桌面,这会给你一个你可以直接使用的链接(例如,http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?)id=284036524&mt=8将AppStore应用于桌面和iPhone上的填字游戏。

Pop this into an NSURL and call openURL on it.

将其弹出到NSURL中,并在其上调用openURL。

#2


26  

To be extremely concise:

非常简洁:

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"itms://itunes.com/apps/appname"]];

If you want to send to all the apps for a developer, use

如果你想为开发者发送所有的应用,请使用

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"itms://itunes.com/apps/developername"]];

These work for iOS 4.1

这些都适用于iOS 4.1

See Also How to link to apps on the app store

请参见如何链接应用程序商店中的应用程序

#3


16  

I figured out how to get straight into the review page for an app in the AppStore.

我找到了如何直接进入AppStore中的应用程序的审查页面。

Basically it's done like below, feel free to read my blog post about it.

基本上是这样做的,请随意阅读我的博文。

- (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]];
}

#4


6  

If you want to show the details of the application instead of the reviews, you can use the url like this:

如果您想要显示应用程序的细节而不是评论,您可以使用以下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]];

I've tested this on my iPhone with iOS 6.1 and will redirect you to the App Store app immediately.

我已经在我的iPhone上测试了iOS 6.1,并会立即将你重定向到App Store应用程序。

#5


5  

Ben Gottlieb is right, but there's a faster way to get the URL: You can right-click on any application icon in iTunes and select "Copy iTunes Store URL".

Ben Gottlieb是对的,但是有一种更快的方法来获取URL:你可以右键点击iTunes中的任何应用程序图标,然后选择“复制iTunes Store URL”。

Then call UIApplication openURL on it.

然后调用UIApplication openURL。

#6


2  

Make sure it says "phobos.apple.com" and not "itunes.apple.com"

一定要写“phobo。apple.com”而不是“itunes.apple.com”

The former opens the App Store directly, while the latter will open MobileSafari first, then the App Store.

前者直接打开App Store,后者先打开MobileSafari,然后是App Store。

#7


2  

You can get your AppID from the itunesconnect.apple.com "Manage Your Applications"

你可以从itunesconnect.apple.com上获取AppID“管理你的应用程序”

#8


1  

If you do not want to get the link for iTunes you can do this.

如果你不想获得iTunes的链接,你可以这么做。

  1. select your app in AppStore
  2. 在AppStore中选择您的应用程序
  3. click the Tell A Friend button in the top right.
  4. 点击右上角的“告诉朋友”按钮。
  5. email the link to yourself
  6. 把链接发给你自己。

I have had this work at time the iTunes link would not.

我曾经有过这样的工作,iTunes链接不会。

#9


0  

If you have an affiliate link and you would like to still open App Store app directly without Safari in the middle, you could use a hidden UIWebView or an NSURLConnection. For the latter see this post http://gamesfromwithin.com/handling-app-store-and-linkshare-links

如果你有一个附属链接,你想要在没有Safari的情况下直接打开App Store应用程序,你可以使用一个隐藏的UIWebView或NSURLConnection。对于后者,请参阅本文http://gamesfromwithin.com/handling-app-stor-linkshare-links

#10


0  

Here is the code I use and tested it against the various iOS versions mentioned. Obviously change the customer id to be your one:

下面是我使用的代码,并针对所提到的各种iOS版本进行了测试。显然,将客户id更改为您的id:

- (void)showOurAppsInAppStore
{        
    NSString *searchUrl = nil;
    // iPad
    if ([DeviceController isDeviceAnIpad]) {
        searchUrl = @"itms-apps://itunes.apple.com/us/artist/seligman-ventures-ltd/id326161338";
    }
    // iPhone / iPod Touch
    else {
        // iOS 7+
        if ([DeviceController isDeviceOperatingSystemAtleast:@"7.0"]) {
            searchUrl = @"itms-apps://itunes.apple.com/artist/seligman-ventures-ltd/id326161338";
        }
        // iOS 6
        else if ([DeviceController isDeviceOperatingSystemAtleast:@"6.0"]) {
            searchUrl = @"itms-apps://ax.itunes.apple.com/artist/seligman-ventures-ltd/id326161338";
        }
        // Pre iOS 6
        else {
            NSString *companyName = @"Seligman Ventures";
            searchUrl = [NSString stringWithFormat:@"http://phobos.apple.com/WebObjects/MZSearch.woa/wa/search?WOURLEncoding=ISO8859_1&lang=1&output=lm&country=US&term=%@&media=software", [companyName stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
        }
    }

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

#11


-1  

If you are just releasing your app... you won't have an "app ID #" yet... so none of those methods will work.

如果你只是发布你的应用…你不会有一个“app ID #”…所以这些方法都不管用。

I had to insert a "non-working link" in my v1.0... and then later in my v1.1 update... added the actual link and app ID #.

我必须在我的v1.0中插入一个“无效链接”……然后在我的v1.1更新中……添加了实际的链接和应用ID #。

#1


19  

From iTunes, drag the icon of your app to the desktop, this will give you a link you can use directly (for example, http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=284036524&mt=8 launches the AppStore to Crosswords, both on a desktop and an iPhone).

从iTunes,把你的应用程序的图标拖到桌面,这会给你一个你可以直接使用的链接(例如,http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?)id=284036524&mt=8将AppStore应用于桌面和iPhone上的填字游戏。

Pop this into an NSURL and call openURL on it.

将其弹出到NSURL中,并在其上调用openURL。

#2


26  

To be extremely concise:

非常简洁:

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"itms://itunes.com/apps/appname"]];

If you want to send to all the apps for a developer, use

如果你想为开发者发送所有的应用,请使用

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"itms://itunes.com/apps/developername"]];

These work for iOS 4.1

这些都适用于iOS 4.1

See Also How to link to apps on the app store

请参见如何链接应用程序商店中的应用程序

#3


16  

I figured out how to get straight into the review page for an app in the AppStore.

我找到了如何直接进入AppStore中的应用程序的审查页面。

Basically it's done like below, feel free to read my blog post about it.

基本上是这样做的,请随意阅读我的博文。

- (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]];
}

#4


6  

If you want to show the details of the application instead of the reviews, you can use the url like this:

如果您想要显示应用程序的细节而不是评论,您可以使用以下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]];

I've tested this on my iPhone with iOS 6.1 and will redirect you to the App Store app immediately.

我已经在我的iPhone上测试了iOS 6.1,并会立即将你重定向到App Store应用程序。

#5


5  

Ben Gottlieb is right, but there's a faster way to get the URL: You can right-click on any application icon in iTunes and select "Copy iTunes Store URL".

Ben Gottlieb是对的,但是有一种更快的方法来获取URL:你可以右键点击iTunes中的任何应用程序图标,然后选择“复制iTunes Store URL”。

Then call UIApplication openURL on it.

然后调用UIApplication openURL。

#6


2  

Make sure it says "phobos.apple.com" and not "itunes.apple.com"

一定要写“phobo。apple.com”而不是“itunes.apple.com”

The former opens the App Store directly, while the latter will open MobileSafari first, then the App Store.

前者直接打开App Store,后者先打开MobileSafari,然后是App Store。

#7


2  

You can get your AppID from the itunesconnect.apple.com "Manage Your Applications"

你可以从itunesconnect.apple.com上获取AppID“管理你的应用程序”

#8


1  

If you do not want to get the link for iTunes you can do this.

如果你不想获得iTunes的链接,你可以这么做。

  1. select your app in AppStore
  2. 在AppStore中选择您的应用程序
  3. click the Tell A Friend button in the top right.
  4. 点击右上角的“告诉朋友”按钮。
  5. email the link to yourself
  6. 把链接发给你自己。

I have had this work at time the iTunes link would not.

我曾经有过这样的工作,iTunes链接不会。

#9


0  

If you have an affiliate link and you would like to still open App Store app directly without Safari in the middle, you could use a hidden UIWebView or an NSURLConnection. For the latter see this post http://gamesfromwithin.com/handling-app-store-and-linkshare-links

如果你有一个附属链接,你想要在没有Safari的情况下直接打开App Store应用程序,你可以使用一个隐藏的UIWebView或NSURLConnection。对于后者,请参阅本文http://gamesfromwithin.com/handling-app-stor-linkshare-links

#10


0  

Here is the code I use and tested it against the various iOS versions mentioned. Obviously change the customer id to be your one:

下面是我使用的代码,并针对所提到的各种iOS版本进行了测试。显然,将客户id更改为您的id:

- (void)showOurAppsInAppStore
{        
    NSString *searchUrl = nil;
    // iPad
    if ([DeviceController isDeviceAnIpad]) {
        searchUrl = @"itms-apps://itunes.apple.com/us/artist/seligman-ventures-ltd/id326161338";
    }
    // iPhone / iPod Touch
    else {
        // iOS 7+
        if ([DeviceController isDeviceOperatingSystemAtleast:@"7.0"]) {
            searchUrl = @"itms-apps://itunes.apple.com/artist/seligman-ventures-ltd/id326161338";
        }
        // iOS 6
        else if ([DeviceController isDeviceOperatingSystemAtleast:@"6.0"]) {
            searchUrl = @"itms-apps://ax.itunes.apple.com/artist/seligman-ventures-ltd/id326161338";
        }
        // Pre iOS 6
        else {
            NSString *companyName = @"Seligman Ventures";
            searchUrl = [NSString stringWithFormat:@"http://phobos.apple.com/WebObjects/MZSearch.woa/wa/search?WOURLEncoding=ISO8859_1&lang=1&output=lm&country=US&term=%@&media=software", [companyName stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
        }
    }

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

#11


-1  

If you are just releasing your app... you won't have an "app ID #" yet... so none of those methods will work.

如果你只是发布你的应用…你不会有一个“app ID #”…所以这些方法都不管用。

I had to insert a "non-working link" in my v1.0... and then later in my v1.1 update... added the actual link and app ID #.

我必须在我的v1.0中插入一个“无效链接”……然后在我的v1.1更新中……添加了实际的链接和应用ID #。