我正在创造自己的iPhone游戏的免费版本。我想在免费版本中添加一个按钮,引导用户进入应用商店中的付费版本。如果我使用标准链接

http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=300136119&mt=8

iPhone首先打开Safari,然后打开应用商店。我使用过其他直接打开应用程序商店的应用程序,所以我知道这是可能的。

什么好主意吗?应用商店的URL方案是什么?


当前回答

苹果刚刚公布了appstore.com的网址。

https://developer.apple.com/library/ios/qa/qa1633/_index.html

There are three types of App Store Short Links, in two forms, one for iOS apps, another for Mac Apps: Company Name iOS: http://appstore.com/ for example, http://appstore.com/apple Mac: http://appstore.com/mac/ for example, http://appstore.com/mac/apple App Name iOS: http://appstore.com/ for example, http://appstore.com/keynote Mac: http://appstore.com/mac/ for example, http://appstore.com/mac/keynote App by Company iOS: http://appstore.com// for example, http://appstore.com/apple/keynote Mac: http://appstore.com/mac// for example, http://appstore.com/mac/apple/keynote Most companies and apps have a canonical App Store Short Link. This canonical URL is created by changing or removing certain characters (many of which are illegal or have special meaning in a URL (for example, "&")). To create an App Store Short Link, apply the following rules to your company or app name: Remove all whitespace Convert all characters to lower-case Remove all copyright (©), trademark (™) and registered mark (®) symbols Replace ampersands ("&") with "and" Remove most punctuation (See Listing 2 for the set) Replace accented and other "decorated" characters (ü, å, etc.) with their elemental character (u, a, etc.) Leave all other characters as-is. Listing 2 Punctuation characters that must be removed. !¡"#$%'()*+,-./:;<=>¿?@[]^_`{|}~ Below are some examples to demonstrate the conversion that takes place. App Store Company Name examples Gameloft => http://appstore.com/gameloft Activision Publishing, Inc. => http://appstore.com/activisionpublishinginc Chen's Photography & Software => http://appstore.com/chensphotographyandsoftware App Name examples Ocarina => http://appstore.com/ocarina Where’s My Perry? => http://appstore.com/wheresmyperry Brain Challenge™ => http://appstore.com/brainchallenge

其他回答

它会直接打开应用商店

NSString *iTunesLink = @"itms-apps://itunes.apple.com/app/ebl- 
skybanking/id1171655193?mt=8";

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:iTunesLink]];

这是工作和直接链接在ios5

NSString *iTunesLink = @"http://itunes.apple.com/app/baseball-stats-tracker-touch/id490256272?mt=8";  
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:iTunesLink]];

如果你想链接到开发商的应用,而开发商的名字中有标点符号或空格(例如Development Company, LLC),你的URL是这样的:

itms-apps://itunes.com/apps/DevelopmentCompanyLLC

否则它在iOS 4.3.3上返回“此请求不能被处理”

2015年夏天开始……

-(IBAction)clickedUpdate
{
    NSString *simple = @"itms-apps://itunes.apple.com/app/id1234567890";
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:simple]];
}

将'id1234567890'替换为'id'和'您的十位数'

这在所有设备上都能完美地工作。 它会直接进入应用商店,没有重定向。 对全国所有商店都是可以的。 的确,你应该转而使用loadProductWithParameters,但如果链接的目的是更新你实际所在的应用程序:使用这种“老式”方法可能更好。

试试这个方法

http://itunes.apple.com/lookup?id=“你的应用ID在这里”返回json。从这里,找到键“trackViewUrl”和值是所需的url。使用这个url(只需将https://替换为itms-apps://)。这工作得很好。

例如,如果你的应用ID是xyz,那么就转到这个链接 http://itunes.apple.com/lookup?id=xyz

然后找到“trackViewUrl”键的url。这是你的应用程序在应用商店的url,在xcode中使用这个url试试这个

NSString *iTunesLink = @"itms-apps://itunes.apple.com/us/app/Your app name/id Your app ID?mt=8&uo=4";
        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:iTunesLink]];

谢谢