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

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

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

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


当前回答

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

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

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

其他回答

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

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

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

当支持多个操作系统和平台时,创建链接可能会成为一个复杂的问题。例如,在iOS 7上不支持WebObjects(其中一些),你创建的一些链接会打开另一个国家的商店,然后用户的等等。

有一个叫做iLink的开源库可以帮助你。

There advantages of this library is that the links would be found and created at run time (the library would check the app ID and the OS it is running on and would figure out what link should be created). The best point in this is that you don't need to configure almost anything before using it so that is error free and would work always. That's great also if you have few targets on same project so you don't have to remember which app ID or link to use. This library also would prompt the user to upgrade the app if there is a new version on the store (this is built in and you turn this off by a simple flag) directly pointing to the upgrade page for the app if user agrees.

复制两个库文件到你的项目(iLink.h & iLink.m)。

在你的appDelegate.m上:

#import "iLink.h"

+ (void)initialize
{
    //configure iLink
    [iLink sharedInstance].globalPromptForUpdate = YES; // If you want iLink to prompt user to update when the app is old.
}

例如,在你想打开评级页面的地方,只需使用:

[[iLink sharedInstance] iLinkOpenAppPageInAppStoreWithAppleID: YOUR_PAID_APP_APPLE_ID]; // You should find YOUR_PAID_APP_APPLE_ID from iTunes Connect 

不要忘记在同一个文件中导入iLink.h。

这里有一个很好的整个库的文档还有一个iPhone和Mac的示例项目。

直接链接:没有重定向而有直接链接:

使用苹果服务营销工具:https://tools.applemediaservices.com/获得真正的直接链接 将https://替换为itms-apps:// 用UIApplication.shared打开链接。打开(url,选项:[:])

注意,这些链接只在实际设备上工作,而不是在模拟器中。

来源:

评论:新的链接归功于@rwcorbett 苹果文档:https://developer.apple.com/library/ios/#qa/qa2008/qa1629.html

苹果刚刚公布了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]];