如何链接到应用商店中的应用 [英] How to link to apps on the app store

查看:54
本文介绍了如何链接到应用商店中的应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建我的 iPhone 游戏的免费版本.我想在免费版本中有一个按钮,可以将人们带到应用商店中的付费版本.如果我使用标准链接

I am creating a free version of my iPhone game. I want to have a button inside the free version that takes people to the paid version in the app store. If I use a standard link

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

iPhone 首先打开 Safari,然后打开应用商店.我用过其他直接打开应用商店的应用,所以我知道是可以的.

the iPhone opens Safari first, and then the app store. I have used other apps that open the app store directly, so I know it is possible.

有什么想法吗?应用商店的 URL Scheme 是什么?

Any ideas? What is the URL Scheme for the app store?

推荐答案

Edited on 2016-02-02

从 iOS 6 开始 SKStoreProductViewController 课程介绍.您无需离开应用程序即可链接应用程序.Swift 3.x/2.xObjective-C 中的代码片段是 这里.

Starting from iOS 6 SKStoreProductViewController class was introduced. You can link an app without leaving your app. Code snippet in Swift 3.x/2.x and Objective-C is here.

一个 SKStoreProductViewController 对象呈现一家允许用户从 App Store 购买其他媒体.例如,您的应用可能会显示商店以允许用户购买其他应用.

A SKStoreProductViewController object presents a store that allows the user to purchase other media from the App Store. For example, your app might display the store to allow the user to purchase another app.


来自面向 Apple 开发者的新闻和公告.

将客户直接吸引到您的应用在 App Store 上使用 iTunes 链接使用 iTunes 链接,您可以提供您的客户可以轻松访问您的应用程序直接在 App Store 上从您的网站或营销活动.创建 iTunes 链接是简单,可以直接客户到单个应用程序,所有您的应用程序,或特定应用程序指定了您的公司名称.

Drive Customers Directly to Your App on the App Store with iTunes Links With iTunes links you can provide your customers with an easy way to access your apps on the App Store directly from your website or marketing campaigns. Creating an iTunes link is simple and can be made to direct customers to either a single app, all your apps, or to a specific app with your company name specified.

将客户发送到特定的应用:http://itunes.com/apps/appname

To send customers to a specific application: http://itunes.com/apps/appname

发送客户到您拥有的应用程序列表在 App Store 上:http://itunes.com/apps/developername

To send customers to a list of apps you have on the App Store: http://itunes.com/apps/developername

将客户发送到特定应用将您的公司名称包含在网址:http://itunes.com/apps/developername/appname

To send customers to a specific app with your company name included in the URL: http://itunes.com/apps/developername/appname


附加说明:

您可以将 http:// 替换为 itms://itms-apps:// 以避免重定向.

You can replace http:// with itms:// or itms-apps:// to avoid redirects.

请注意itms://会将用户发送到iTunes商店itms-apps:// 并将它们发送到 App Store!

Please note that itms:// will send the user to the iTunes store and itms-apps:// with send them to the App Store!

有关命名的信息,请参阅 Apple QA1633:

For info on naming, see Apple QA1633:

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

编辑(截至 2015 年 1 月):

itunes.com/apps 链接应更新为 appstore.com/apps.请参阅上面的 QA1633,已更新.一个新的 QA1629 建议了这些步骤和代码来启动商店一个应用程序:

itunes.com/apps links should be updated to appstore.com/apps. See QA1633 above, which has been updated. A new QA1629 suggests these steps and code for launching the store from an app:

  1. 在您的计算机上启动 iTunes.
  2. 搜索您要链接到的项目.
  3. 右键单击或按住 Control 单击 iTunes 中的项目名称,然后选择复制 iTunes Store URL";从弹出菜单中.
  4. 在您的应用程序中,使用复制的 iTunes URL 创建一个 NSURL 对象,然后将此对象传递给 UIApplicationopenURL: 方法以在 App Store 中打开您的项目.
  1. Launch iTunes on your computer.
  2. Search for the item you want to link to.
  3. Right-click or control-click on the item's name in iTunes, then choose "Copy iTunes Store URL" from the pop-up menu.
  4. In your application, create an NSURL object with the copied iTunes URL, then pass this object to UIApplication' s openURL: method to open your item in the App Store.

示例代码:

NSString *iTunesLink = @"itms://itunes.apple.com/app/apple-store/id375380948?mt=8";
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:iTunesLink]];

iOS10+:

 [[UIApplication sharedApplication] openURL:[NSURL URLWithString:iTunesLink] options:@{} completionHandler:nil];

Swift 4.2

   let urlStr = "itms-apps://itunes.apple.com/app/apple-store/id375380948?mt=8"
    if #available(iOS 10.0, *) {
        UIApplication.shared.open(URL(string: urlStr)!, options: [:], completionHandler: nil)
        
    } else {
        UIApplication.shared.openURL(URL(string: urlStr)!)
    }

这篇关于如何链接到应用商店中的应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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