如何链接到应用商店中的应用

发布于 2024-07-10 19:51:55 字数 397 浏览 11 评论 0 原文

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

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

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

有任何想法吗? 应用商店的 URL 方案是什么?

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

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.

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(28

菩提树下叶撕阳。 2024-07-17 19:51:56

对我来说(2023 年)itms-apps:// 不起作用,但 itms-appss:// 可以!

itms-appss://apps.apple.com/app/idYOUR_ID_HERE

我怀疑苹果添加了额外的 s 因为他们不希望我们再使用它,但在一些边缘情况下它仍然非常有用。

对于 99% 的情况,您需要使用常规链接:

https://apps.apple.com/us/app/wavelength/idYOUR_ID_HERE

For me (in 2023) itms-apps:// doesn't work but itms-appss:// does!

itms-appss://apps.apple.com/app/idYOUR_ID_HERE

I suspect Apple added the extra s because they don't want us using it any more but there are some edge cases where it's still extremely helpful.

For 99% of cases you'll want to use the regular link:

https://apps.apple.com/us/app/wavelength/idYOUR_ID_HERE
栀梦 2024-07-17 19:51:56

尝试这样

http://itunes.apple.com/lookup?id=“您的应用ID here”返回 json。从中找到键“trackViewUrl”,值是所需的 url。 使用此网址(只需将 https:// 替换为 itms-apps://)。这效果很好。

例如,如果您的应用程序 ID 是 xyz,则转到此链接
http://itunes.apple.com/lookup?id=xyz

然后找到网址对于键“trackViewUrl”。这是您的应用程序在应用程序商店中的网址,要在 xcode 中使用此网址,请尝试此

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

谢谢

Try this way

http://itunes.apple.com/lookup?id="your app ID here" return json.From this, find key "trackViewUrl" and value is the desired url. use this url(just replace https:// with itms-apps://).This works just fine.

For example if your app ID is xyz then go to this link
http://itunes.apple.com/lookup?id=xyz

Then find the url for key "trackViewUrl".This is the url for your app in app store and to use this url in xcode try this

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

Thanks

无需解释 2024-07-17 19:51:56

在 SwiftUI - iOS 15.0 中

//
//  Test.swift
//  PharmaCodex
//

import SwiftUI

struct Test: View {
    
    var body: some View {
        
        VStack {
            
            Button(action: {
                guard let writeReviewURL = URL(string: "https://apps.apple.com/app/id1629135515?action=write-review") else {
                    fatalError("Expected a valid URL")
                }
                UIApplication.shared.open(writeReviewURL, options: [:], completionHandler: nil)
                
            }) {
                Text("Rate/Review")
            }
            
            
        }
    }
}

struct Test_Previews: PreviewProvider {
    static var previews: some View {
        Test()
    }
}

in SwiftUI - IOS 15.0

//
//  Test.swift
//  PharmaCodex
//

import SwiftUI

struct Test: View {
    
    var body: some View {
        
        VStack {
            
            Button(action: {
                guard let writeReviewURL = URL(string: "https://apps.apple.com/app/id1629135515?action=write-review") else {
                    fatalError("Expected a valid URL")
                }
                UIApplication.shared.open(writeReviewURL, options: [:], completionHandler: nil)
                
            }) {
                Text("Rate/Review")
            }
            
            
        }
    }
}

struct Test_Previews: PreviewProvider {
    static var previews: some View {
        Test()
    }
}
暮年 2024-07-17 19:51:55

编辑于 2016-02-02

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

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


来自针对 Apple 开发者的新闻和公告

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

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

发送
客户访问您拥有的应用程序列表
在应用商店:
http://itunes.com/apps/developername

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


其他说明:

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

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

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

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

编辑(截至 2015 年 1 月):

itunes.com/apps 链接应更新为 appstore.com/apps。 请参阅上面的 QA1633,该内容已更新。 新的 QA1629 建议了以下启动商店的步骤和代码应用程序:

  1. 在计算机上启动 iTunes。
  2. 搜索您要链接到的项目。
  3. 在 iTunes 中右键单击或按住 Control 键单击该项目的名称,然后从弹出菜单中选取“复制 iTunes Store URL”。
  4. 在您的应用程序中,使用复制的 iTunes URL 创建一个 NSURL 对象,然后将此对象传递给 UIApplicationopenURL: 方法以打开您的项目在应用商店中。

示例代码:

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)!)
    }

Edited on 2016-02-02

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.

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.


From News and Announcement For Apple Developers.

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.

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

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

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


Additional notes:

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

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

For info on naming, see Apple QA1633:

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

Edit (as of January 2015):

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. 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.

Sample code:

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)!)
    }
迟到的我 2024-07-17 19:51:55

如果你想直接打开一个应用程序到App Store,你应该使用:

itms-apps://...

这样就会直接打开设备中的App Store应用程序,而不是先去iTunes,然后才打开App Store(仅使用 itms:// 时)


编辑:2017 年 4 月。
itms-apps:// 实际上在 iOS10 中又可以工作了。 我测试过。

编辑:2013 年 4 月。
这在 iOS5 及更高版本中不再起作用。 只需使用

https://itunes.apple.com/app/id378458261

,就不再有重定向。

If you want to open an app directly to the App Store, you should use:

itms-apps://...

This way it will directly open the App Store app in the device, instead of going to iTunes first, then only open the App Store (when using just itms://)


EDIT: APR, 2017.
itms-apps:// actually works again in iOS10. I tested it.

EDIT: APR, 2013.
This no longer works in iOS5 and above. Just use

https://itunes.apple.com/app/id378458261

and there are no more redirects.

秉烛思 2024-07-17 19:51:55

从 iOS 6 开始,正确的方法是使用 SKStoreProductViewController 类。

Swift 5.x

func openStoreProductWithiTunesItemIdentifier(_ identifier: String) {
    let storeViewController = SKStoreProductViewController()
    storeViewController.delegate = self

    let parameters = [ SKStoreProductParameterITunesItemIdentifier : identifier]
    storeViewController.loadProduct(withParameters: parameters) { [weak self] (loaded, error) -> Void in
        if loaded {
            // Parent class of self is UIViewContorller
            self?.present(storeViewController, animated: true, completion: nil)
        }
    }
}
private func productViewControllerDidFinish(viewController: SKStoreProductViewController) {
    viewController.dismiss(animated: true, completion: nil)
}
// Usage:
openStoreProductWithiTunesItemIdentifier("1234567")

Swift 3.x

func openStoreProductWithiTunesItemIdentifier(identifier: String) {
    let storeViewController = SKStoreProductViewController()
    storeViewController.delegate = self

    let parameters = [ SKStoreProductParameterITunesItemIdentifier : identifier]
    storeViewController.loadProduct(withParameters: parameters) { [weak self] (loaded, error) -> Void in
        if loaded {
            // Parent class of self is UIViewContorller
            self?.present(storeViewController, animated: true, completion: nil)
        }
    }
}

func productViewControllerDidFinish(_ viewController: SKStoreProductViewController) {
    viewController.dismiss(animated: true, completion: nil)
}
// Usage:
openStoreProductWithiTunesItemIdentifier(identifier: "13432")

您可以像这样获取应用程序的 itunes 项目标识符:(而不是静态的)

Swift 3.2

var appID: String = infoDictionary["CFBundleIdentifier"]
var url = URL(string: "http://itunes.apple.com/lookup?bundleId=\(appID)")
var data = Data(contentsOf: url!)
var lookup = try? JSONSerialization.jsonObject(with: data!, options: []) as? [AnyHashable: Any]
var appITunesItemIdentifier = lookup["results"][0]["trackId"] as? String
openStoreProductViewController(withITunesItemIdentifier: Int(appITunesItemIdentifier!) ?? 0)

Swift 2.x

func openStoreProductWithiTunesItemIdentifier(identifier: String) {
    let storeViewController = SKStoreProductViewController()
    storeViewController.delegate = self

    let parameters = [ SKStoreProductParameterITunesItemIdentifier : identifier]
    storeViewController.loadProductWithParameters(parameters) { [weak self] (loaded, error) -> Void in
        if loaded {
            // Parent class of self is UIViewContorller
            self?.presentViewController(storeViewController, animated: true, completion: nil)
        }
    }
}

func productViewControllerDidFinish(viewController: SKStoreProductViewController) {
    viewController.dismissViewControllerAnimated(true, completion: nil)
}
// Usage
openStoreProductWithiTunesItemIdentifier("2321354")

objective-C

static NSInteger const kAppITunesItemIdentifier = 324684580;
[self openStoreProductViewControllerWithITunesItemIdentifier:kAppITunesItemIdentifier];

- (void)openStoreProductViewControllerWithITunesItemIdentifier:(NSInteger)iTunesItemIdentifier {
    SKStoreProductViewController *storeViewController = [[SKStoreProductViewController alloc] init];

    storeViewController.delegate = self;

    NSNumber *identifier = [NSNumber numberWithInteger:iTunesItemIdentifier];

    NSDictionary *parameters = @{ SKStoreProductParameterITunesItemIdentifier:identifier };
    UIViewController *viewController = self.window.rootViewController;
    [storeViewController loadProductWithParameters:parameters
                                   completionBlock:^(BOOL result, NSError *error) {
                                       if (result)
                                           [viewController presentViewController:storeViewController
                                                              animated:YES
                                                            completion:nil];
                                       else NSLog(@"SKStoreProductViewController: %@", error);
                                   }];

    [storeViewController release];
}

#pragma mark - SKStoreProductViewControllerDelegate

- (void)productViewControllerDidFinish:(SKStoreProductViewController *)viewController {
    [viewController dismissViewControllerAnimated:YES completion:nil];
}

您可以像这样获取kAppITunesItemIdentifier(应用程序的itunes项目标识符):(而不是静态的)

NSDictionary* infoDictionary = [[NSBundle mainBundle] infoDictionary];
    NSString* appID = infoDictionary[@"CFBundleIdentifier"];
    NSURL* url = [NSURL URLWithString:[NSString stringWithFormat:@"http://itunes.apple.com/lookup?bundleId=%@", appID]];
    NSData* data = [NSData dataWithContentsOfURL:url];
    NSDictionary* lookup = [NSJSONSerialization JSONObjectWithData:data options:0 error:nil];
    NSString * appITunesItemIdentifier =  lookup[@"results"][0][@"trackId"]; 
    [self openStoreProductViewControllerWithITunesItemIdentifier:[appITunesItemIdentifier intValue]];

Starting from iOS 6 right way to do it by using SKStoreProductViewController class.

Swift 5.x:

func openStoreProductWithiTunesItemIdentifier(_ identifier: String) {
    let storeViewController = SKStoreProductViewController()
    storeViewController.delegate = self

    let parameters = [ SKStoreProductParameterITunesItemIdentifier : identifier]
    storeViewController.loadProduct(withParameters: parameters) { [weak self] (loaded, error) -> Void in
        if loaded {
            // Parent class of self is UIViewContorller
            self?.present(storeViewController, animated: true, completion: nil)
        }
    }
}
private func productViewControllerDidFinish(viewController: SKStoreProductViewController) {
    viewController.dismiss(animated: true, completion: nil)
}
// Usage:
openStoreProductWithiTunesItemIdentifier("1234567")

Swift 3.x:

func openStoreProductWithiTunesItemIdentifier(identifier: String) {
    let storeViewController = SKStoreProductViewController()
    storeViewController.delegate = self

    let parameters = [ SKStoreProductParameterITunesItemIdentifier : identifier]
    storeViewController.loadProduct(withParameters: parameters) { [weak self] (loaded, error) -> Void in
        if loaded {
            // Parent class of self is UIViewContorller
            self?.present(storeViewController, animated: true, completion: nil)
        }
    }
}

func productViewControllerDidFinish(_ viewController: SKStoreProductViewController) {
    viewController.dismiss(animated: true, completion: nil)
}
// Usage:
openStoreProductWithiTunesItemIdentifier(identifier: "13432")

You can get the app's itunes item identifier like this: (instead of a static one)

Swift 3.2

var appID: String = infoDictionary["CFBundleIdentifier"]
var url = URL(string: "http://itunes.apple.com/lookup?bundleId=\(appID)")
var data = Data(contentsOf: url!)
var lookup = try? JSONSerialization.jsonObject(with: data!, options: []) as? [AnyHashable: Any]
var appITunesItemIdentifier = lookup["results"][0]["trackId"] as? String
openStoreProductViewController(withITunesItemIdentifier: Int(appITunesItemIdentifier!) ?? 0)

Swift 2.x:

func openStoreProductWithiTunesItemIdentifier(identifier: String) {
    let storeViewController = SKStoreProductViewController()
    storeViewController.delegate = self

    let parameters = [ SKStoreProductParameterITunesItemIdentifier : identifier]
    storeViewController.loadProductWithParameters(parameters) { [weak self] (loaded, error) -> Void in
        if loaded {
            // Parent class of self is UIViewContorller
            self?.presentViewController(storeViewController, animated: true, completion: nil)
        }
    }
}

func productViewControllerDidFinish(viewController: SKStoreProductViewController) {
    viewController.dismissViewControllerAnimated(true, completion: nil)
}
// Usage
openStoreProductWithiTunesItemIdentifier("2321354")

objective-C:

static NSInteger const kAppITunesItemIdentifier = 324684580;
[self openStoreProductViewControllerWithITunesItemIdentifier:kAppITunesItemIdentifier];

- (void)openStoreProductViewControllerWithITunesItemIdentifier:(NSInteger)iTunesItemIdentifier {
    SKStoreProductViewController *storeViewController = [[SKStoreProductViewController alloc] init];

    storeViewController.delegate = self;

    NSNumber *identifier = [NSNumber numberWithInteger:iTunesItemIdentifier];

    NSDictionary *parameters = @{ SKStoreProductParameterITunesItemIdentifier:identifier };
    UIViewController *viewController = self.window.rootViewController;
    [storeViewController loadProductWithParameters:parameters
                                   completionBlock:^(BOOL result, NSError *error) {
                                       if (result)
                                           [viewController presentViewController:storeViewController
                                                              animated:YES
                                                            completion:nil];
                                       else NSLog(@"SKStoreProductViewController: %@", error);
                                   }];

    [storeViewController release];
}

#pragma mark - SKStoreProductViewControllerDelegate

- (void)productViewControllerDidFinish:(SKStoreProductViewController *)viewController {
    [viewController dismissViewControllerAnimated:YES completion:nil];
}

You can get kAppITunesItemIdentifier (app's itunes item identifier) like this: (instead of a static one)

NSDictionary* infoDictionary = [[NSBundle mainBundle] infoDictionary];
    NSString* appID = infoDictionary[@"CFBundleIdentifier"];
    NSURL* url = [NSURL URLWithString:[NSString stringWithFormat:@"http://itunes.apple.com/lookup?bundleId=%@", appID]];
    NSData* data = [NSData dataWithContentsOfURL:url];
    NSDictionary* lookup = [NSJSONSerialization JSONObjectWithData:data options:0 error:nil];
    NSString * appITunesItemIdentifier =  lookup[@"results"][0][@"trackId"]; 
    [self openStoreProductViewControllerWithITunesItemIdentifier:[appITunesItemIdentifier intValue]];
花开半夏魅人心 2024-07-17 19:51:55

Apple 刚刚公布了 appstore.com 网址。

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

App Store 短链接分为三种类型,有两种形式,一种用于 iOS 应用程序,另一种用于 Mac 应用程序:

公司名称

iOS:http://appstore.com/ 例如,http://appstore.com/apple

Mac:http://appstore.com/mac/ 例如,http://appstore.com/mac/apple

应用程序名称

iOS:http://appstore.com/ 例如,http://appstore.com/keynote

Mac:http://appstore.com/mac/ 例如,http://appstore.com/mac/keynote

公司应用

iOS:http://appstore.com// 例如,http://appstore.com/apple/keynote

Mac:http://appstore.com/mac// 例如,http://appstore.com/mac/apple/keynote

大多数公司和应用程序都有规范的应用程序商店短链接。 此规范 URL 是通过更改或删除某些字符(其中许多字符是非法的或在 URL 中具有特殊含义(例如“&”))创建的。

要创建 App Store 短链接,请将以下规则应用于您的公司或应用名称:

删除所有空格

将所有字符转换为小写

删除所有版权 (©)、商标 (™) 和注册商标 (®) 符号

将&符号(“&”)替换为“and”

删除大部分标点符号(参见清单 2 中的设置)

将重音字符和其他“修饰”字符(ü、å 等)替换为其基本字符(u、a 等)

保留所有其他字符不变。

列出 2 个必须删除的标点符号。

!¡"#$%'()*+,-./:;<=>¿?@[]^_`{|}~

下面是一些示例来演示所发生的转换。

应用商店

公司名称示例

Gameloft => http://appstore.com/gameloft

动视出版公司=> http://appstore.com/activisionpublishinginc

陈的摄影与创作 软件=> http://appstore.com/chensphotographyandsoftware

应用程序名称示例

陶笛=> http://appstore.com/ocarina

我的佩里在哪里? => http://appstore.com/wheresmyperry

大脑挑战™ => http://appstore.com/brainchallenge

Apple just announced the appstore.com urls.

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

忱杏 2024-07-17 19:51:55

从 2015 年夏季开始...

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

将“id1234567890”替换为“id”和“您的十位数字”

  1. 这在所有设备上完美运行。

  2. 它确实直接进入应用商店,没有重定向。

  3. 适用于所有全国商店

  4. 确实,您应该转向使用 loadProductWithParameters但是如果链接的目的是更新您实际所在的应用程序:使用这种“老式”方法可能会更好。

For summer 2015 onwards ...

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

replace 'id1234567890' with 'id' and 'your ten digit number'

  1. This works perfectly on all devices.

  2. It does go straight to the app store, no redirects.

  3. Is OK for all national stores.

  4. It's true you should move to using loadProductWithParameters, but if the purpose of the link is to update the app you are actually inside of: it's possibly better to use this "old-fashioned" approach.

遇到 2024-07-17 19:51:55

要获得不重定向的直接链接:

  1. 使用 Apple 服务营销工具:https://tools.applemediaservices.com/获取真正的直接链接
  2. https:// 替换为 itms-apps://
  3. 使用 UIApplication.shared.open(url, options: [:])

请注意,这些链接仅适用于实际设备,不适用于模拟器。

资料来源:

To have a direct link without redirection :

  1. Use Apple Services Marketing Tools : https://tools.applemediaservices.com/ to get the real direct link
  2. Replace the https:// with itms-apps://
  3. Open the link with UIApplication.shared.open(url, options: [:])

Be careful, those links only works on actual devices, not in simulator.

Source :

独夜无伴 2024-07-17 19:51:55

此代码在 iOS 上生成 App Store 链接 在

NSString *appName = [NSString stringWithString:[[[NSBundle mainBundle] infoDictionary]   objectForKey:@"CFBundleName"]];
NSURL *appStoreURL = [NSURL URLWithString:[NSString stringWithFormat:@"itms-apps://itunes.com/app/%@",[appName stringByReplacingOccurrencesOfString:@" " withString:@""]]];

Mac 上将 itms-apps 替换为 http:

NSURL *appStoreURL = [NSURL URLWithString:[NSString stringWithFormat:@"http:/itunes.com/app/%@",[appName stringByReplacingOccurrencesOfString:@" " withString:@""]]]; 

在 iOS 上打开 URL:

[[UIApplication sharedApplication] openURL:appStoreURL];

Mac:

[[NSWorkspace sharedWorkspace] openURL:appStoreURL];

This code generates the App Store link on iOS

NSString *appName = [NSString stringWithString:[[[NSBundle mainBundle] infoDictionary]   objectForKey:@"CFBundleName"]];
NSURL *appStoreURL = [NSURL URLWithString:[NSString stringWithFormat:@"itms-apps://itunes.com/app/%@",[appName stringByReplacingOccurrencesOfString:@" " withString:@""]]];

Replace itms-apps with http on Mac:

NSURL *appStoreURL = [NSURL URLWithString:[NSString stringWithFormat:@"http:/itunes.com/app/%@",[appName stringByReplacingOccurrencesOfString:@" " withString:@""]]]; 

Open URL on iOS:

[[UIApplication sharedApplication] openURL:appStoreURL];

Mac:

[[NSWorkspace sharedWorkspace] openURL:appStoreURL];
花落人断肠 2024-07-17 19:51:55

只需在应用程序链接中将“itunes”更改为“phobos”即可。

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

现在会直接打开App Store

Simply change 'itunes' to 'phobos' in the app link.

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

Now it will open the App Store directly

焚却相思 2024-07-17 19:51:55

这对我来说非常有效,仅使用 APP ID:

 NSString *urlString = [NSString stringWithFormat:@"http://itunes.apple.com/app/id%@",YOUR_APP_ID];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlString]];

重定向数量为零。

This worked for me perfectly using only APP ID:

 NSString *urlString = [NSString stringWithFormat:@"http://itunes.apple.com/app/id%@",YOUR_APP_ID];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlString]];

The number of redirects is ZERO.

咿呀咿呀哟 2024-07-17 19:51:55

许多答案建议使用“itms”或“itms-apps”,但 Apple 并未特别推荐这种做法。 他们仅提供以下方式打开 App Store:

清单 1 从 iOS 应用程序启动 App Store

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

请参阅https://developer.apple.com/library/ios/qa/qa1629/_index.html 最后更新于 2014 年 3 月截至此答案。

对于支持 iOS 6 及更高版本的应用程序,Apple 提供了一种应用程序内机制来呈现 App Store:SKStoreProductViewController

- (void)loadProductWithParameters:(NSDictionary *)parameters completionBlock:(void (^)(BOOL result, NSError *error))block;

// Example:
SKStoreProductViewController* spvc = [[SKStoreProductViewController alloc] init];
spvc.delegate = self;
[spvc loadProductWithParameters:@{ SKStoreProductParameterITunesItemIdentifier : @(364709193) } completionBlock:^(BOOL result, NSError *error){ 
    if (error)
        // Show sorry
    else
        // Present spvc
}];

请注意,在 iOS6 上,如果出现错误,可能不会调用完成块。 这似乎是 iOS 7 中解决的一个错误。

A number of answers suggest using 'itms' or 'itms-apps' but this practice is not specifically recommended by Apple. They only offer the following way to open the App Store:

Listing 1 Launching the App Store from an iOS application

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

See https://developer.apple.com/library/ios/qa/qa1629/_index.html last updated March, 2014 as of this answer.

For apps that support iOS 6 and above, Apple offers a in-app mechanism for presenting the App Store: SKStoreProductViewController

- (void)loadProductWithParameters:(NSDictionary *)parameters completionBlock:(void (^)(BOOL result, NSError *error))block;

// Example:
SKStoreProductViewController* spvc = [[SKStoreProductViewController alloc] init];
spvc.delegate = self;
[spvc loadProductWithParameters:@{ SKStoreProductParameterITunesItemIdentifier : @(364709193) } completionBlock:^(BOOL result, NSError *error){ 
    if (error)
        // Show sorry
    else
        // Present spvc
}];

Note that on iOS6, the completion block may not be called if there are errors. This appears to be a bug that was resolved in iOS 7.

小霸王臭丫头 2024-07-17 19:51:55

如果您想链接到开发人员的应用程序,并且开发人员的名称包含标点符号或空格(例如 Development Company, LLC),请像这样形成您的 URL:

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

否则,它会在 iOS 4.3.3 上返回“无法处理此请求”

If you want to link to a developer's apps and the developer's name has punctuation or spaces (e.g. Development Company, LLC) form your URL like this:

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

Otherwise it returns "This request cannot be processed" on iOS 4.3.3

酒儿 2024-07-17 19:51:55

您可以通过链接创建器获取应用商店或 iTunes 中特定项目的链接:
http://itunes.apple.com/linkmaker/

You can get a link to a specific item in the app store or iTunes through the link maker at:
http://itunes.apple.com/linkmaker/

听闻余生 2024-07-17 19:51:55

这在 ios5 中可以正常工作并直接链接

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

This is working and directly linking in ios5

NSString *iTunesLink = @"http://itunes.apple.com/app/baseball-stats-tracker-touch/id490256272?mt=8";  
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:iTunesLink]];
你げ笑在眉眼 2024-07-17 19:51:55

所有的答案都已经过时并且不起作用; 使用下面的方法。

开发者的所有应用程序:
itms-apps://apps.apple.com/developer/developer-name/developerId

单个应用程序:
itms-apps://itunes.apple.com/app/appId

All the answers are outdated and don't work; use the below method.

All apps of a developer:
itms-apps://apps.apple.com/developer/developer-name/developerId

Single app:
itms-apps://itunes.apple.com/app/appId

陪你到最终 2024-07-17 19:51:55

这是重定向/链接应用商店中其他现有应用程序的简单而简短的方法。

 NSString *customURL = @"http://itunes.apple.com/app/id951386316";

 if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:customURL]])
 {
       [[UIApplication sharedApplication] openURL:[NSURL URLWithString:customURL]];
 } 

This is simple and short way to redirect/link other existing application on app store.

 NSString *customURL = @"http://itunes.apple.com/app/id951386316";

 if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:customURL]])
 {
       [[UIApplication sharedApplication] openURL:[NSURL URLWithString:customURL]];
 } 
我一直都在从未离去 2024-07-17 19:51:55

对于 Xcode 9.1 和 Swift 4:

  1. 导入 StoreKit:
导入 StoreKit 
  

2.遵守协议

SKStoreProductViewControllerDelegate

3.执行协议

func openStoreProductWithiTunesItemIdentifier(identifier: String) {
    let storeViewController = SKStoreProductViewController()
    storeViewController.delegate = self

    let parameters = [ SKStoreProductParameterITunesItemIdentifier : identifier]
    storeViewController.loadProduct(withParameters: parameters) { [weak self] (loaded, error) -> Void in

        if loaded {
            // Parent class of self is UIViewContorller
            self?.present(storeViewController, animated: true, completion: nil)
        }
    }   
}

3.1

func productViewControllerDidFinish(_ viewController: SKStoreProductViewController) {
    viewController.dismiss(animated: true, completion: nil)
}
  1. 使用方法:
openStoreProductWithiTunesItemIdentifier(标识符:“here_put_your_App_id”) 
  

笔记:

输入您的应用程序的准确 ID 非常重要。 因为这会导致错误(不显示错误日志,但因此没有任何效果)

For Xcode 9.1 and Swift 4:

  1. Import StoreKit:
import StoreKit

2.Conform the protocol

SKStoreProductViewControllerDelegate

3.Implement the protocol

func openStoreProductWithiTunesItemIdentifier(identifier: String) {
    let storeViewController = SKStoreProductViewController()
    storeViewController.delegate = self

    let parameters = [ SKStoreProductParameterITunesItemIdentifier : identifier]
    storeViewController.loadProduct(withParameters: parameters) { [weak self] (loaded, error) -> Void in

        if loaded {
            // Parent class of self is UIViewContorller
            self?.present(storeViewController, animated: true, completion: nil)
        }
    }   
}

3.1

func productViewControllerDidFinish(_ viewController: SKStoreProductViewController) {
    viewController.dismiss(animated: true, completion: nil)
}
  1. How to use:
openStoreProductWithiTunesItemIdentifier(identifier: "here_put_your_App_id")

Note:

It is very important to enter the exact ID of your APP. Because this cause error (not show the error log, but nothing works fine because of this)

暮凉 2024-07-17 19:51:55

我可以确认,如果您在 iTunes connect 中创建应用程序,您会在提交之前获取您的应用程序 ID。

因此..

itms-apps://itunes.apple.com/app/id123456789

NSURL *appStoreURL = [NSURL URLWithString:@"itms-apps://itunes.apple.com/app/id123456789"];
    if ([[UIApplication sharedApplication]canOpenURL:appStoreURL])
        [[UIApplication sharedApplication]openURL:appStoreURL];

工作是一种享受

I can confirm that if you create an app in iTunes connect you get your app id before you submit it.

Therefore..

itms-apps://itunes.apple.com/app/id123456789

NSURL *appStoreURL = [NSURL URLWithString:@"itms-apps://itunes.apple.com/app/id123456789"];
    if ([[UIApplication sharedApplication]canOpenURL:appStoreURL])
        [[UIApplication sharedApplication]openURL:appStoreURL];

Works a treat

生寂 2024-07-17 19:51:55

我认为苹果已经为应用程序链接提供了一个新的链接:
https://apps.apple.com/app/id1445530088https://apps.apple.com/app/ {your_app_id}

I think Apple has provided a new link for the app link:
https://apps.apple.com/app/id1445530088 or https://apps.apple.com/app/ {your_app_id}

愛放△進行李 2024-07-17 19:51:55

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

有一个名为 iLink 可以帮助您。

该库的优点是将在运行时找到并创建链接(该库将检查应用程序 ID 及其运行的操作系统,并确定应创建哪个链接)。 最好的一点是,您在使用它之前几乎不需要配置任何内容,这样就不会出现错误并且始终可以工作。 如果您在同一项目上只有很少的目标,那么这也很棒,这样您就不必记住要使用哪个应用程序 ID 或链接。 如果商店中有新版本(这是内置的,您可以通过简单的标志将其关闭),该库还会提示用户升级应用程序,如果用户同意,则直接指向应用程序的升级页面。

将 2 个库文件复制到您的项目中 (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 的示例项目。

Creating a link could become a complex issue when supporting multiple OS and multiple platform. For example the WebObjects isn't supported on iOS 7 (some of them), some links you create would open another country store then the user's etc.

There is an open source library called iLink that could help you.

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.

Copy the 2 library files to your project (iLink.h & iLink.m).

On your 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.
}

and on the place you want to open the rating page for example just use:

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

Don't forget to import iLink.h on the same file.

There is a very good doc for the whole library there and an example projects for iPhone and for Mac.

待"谢繁草 2024-07-17 19:51:55

至少 iOS 9 及以上版本

  • 直接在 App Store 中打开

应用程序列表

itms-apps://itunes.apple.com/app/[appName]/[appID]

应用程序 开发者

itms-apps://itunes.apple.com/developer/[developerName]/[developerID]

At least iOS 9 and above

  • Open directly in the App Store

An app

itms-apps://itunes.apple.com/app/[appName]/[appID]

List of developer's apps

itms-apps://itunes.apple.com/developer/[developerName]/[developerID]
养猫人 2024-07-17 19:51:55

根据Apple最新文档
您需要使用

appStoreLink = "https://itunes.apple.com/us/app/apple-store/id375380948?mt=8"  

SKStoreProductViewController 

According to Apple's latest document
You need to use

appStoreLink = "https://itunes.apple.com/us/app/apple-store/id375380948?mt=8"  

or

SKStoreProductViewController 
╰ゝ天使的微笑 2024-07-17 19:51:55

尽管这里有很多答案,但链接到开发人员应用程序的建议似乎都不再有效。

当我上次访问时,我能够使用以下格式使其工作:

itms-apps://itunes.apple.com/developer/developer-name/id123456789

这不再有效,但删除开发人员名称可以:

itms-apps://itunes.apple.com/developer/id123456789

Despite there being loads of answers here, none of the suggestions for linking to the developers apps seem to work anymore.

When I last visited I was able to get it working using the format:

itms-apps://itunes.apple.com/developer/developer-name/id123456789

This no longer works, but removing the developer name does:

itms-apps://itunes.apple.com/developer/id123456789
2024-07-17 19:51:55

如果您有应用程序商店 ID,则最好使用它。 特别是如果您将来可能更改应用程序的名称。

http://itunes.apple.com/app/id378458261

如果您没有应用商店 ID,您可以根据此文档创建一个 url https://developer.apple.com/library/ios/qa/qa1633/_index.html

+ (NSURL *)appStoreURL
{
    static NSURL *appStoreURL;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        appStoreURL = [self appStoreURLFromBundleName:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"]];
    });
    return appStoreURL;
}

+ (NSURL *)appStoreURLFromBundleName:(NSString *)bundleName
{
    NSURL *appStoreURL = [NSURL URLWithString:[NSString stringWithFormat:@"itms-apps://itunes.com/app/%@", [self sanitizeAppStoreResourceSpecifier:bundleName]]];
    return appStoreURL;
}

+ (NSString *)sanitizeAppStoreResourceSpecifier:(NSString *)resourceSpecifier
{
    /*
     https://developer.apple.com/library/ios/qa/qa1633/_index.html
     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.
     */
    resourceSpecifier = [resourceSpecifier stringByReplacingOccurrencesOfString:@"&" withString:@"and"];
    resourceSpecifier = [[NSString alloc] initWithData:[resourceSpecifier dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES] encoding:NSASCIIStringEncoding];
    resourceSpecifier = [resourceSpecifier stringByReplacingOccurrencesOfString:@"[!¡\"#$%'()*+,-./:;<=>¿?@\\[\\]\\^_`{|}~\\s\\t\\n]" withString:@"" options:NSRegularExpressionSearch range:NSMakeRange(0, resourceSpecifier.length)];
    resourceSpecifier = [resourceSpecifier lowercaseString];
    return resourceSpecifier;
}

通过此测试

- (void)testAppStoreURLFromBundleName
{
    STAssertEqualObjects([AGApplicationHelper appStoreURLFromBundleName:@"Nuclear™"].absoluteString, @"itms-apps://itunes.com/app/nuclear", nil);
    STAssertEqualObjects([AGApplicationHelper appStoreURLFromBundleName:@"Magazine+"].absoluteString, @"itms-apps://itunes.com/app/magazine", nil);
    STAssertEqualObjects([AGApplicationHelper appStoreURLFromBundleName:@"Karl & CO"].absoluteString, @"itms-apps://itunes.com/app/karlandco", nil);
    STAssertEqualObjects([AGApplicationHelper appStoreURLFromBundleName:@"[Fluppy fuck]"].absoluteString, @"itms-apps://itunes.com/app/fluppyfuck", nil);
    STAssertEqualObjects([AGApplicationHelper appStoreURLFromBundleName:@"Pollos Hérmanos"].absoluteString, @"itms-apps://itunes.com/app/polloshermanos", nil);
    STAssertEqualObjects([AGApplicationHelper appStoreURLFromBundleName:@"Niños and niñas"].absoluteString, @"itms-apps://itunes.com/app/ninosandninas", nil);
    STAssertEqualObjects([AGApplicationHelper appStoreURLFromBundleName:@"Trond, MobizMag"].absoluteString, @"itms-apps://itunes.com/app/trondmobizmag", nil);
    STAssertEqualObjects([AGApplicationHelper appStoreURLFromBundleName:@"!__SPECIAL-PLIZES__!"].absoluteString, @"itms-apps://itunes.com/app/specialplizes", nil);
}

If you have the app store id you are best off using it. Especially if you in the future might change the name of the application.

http://itunes.apple.com/app/id378458261

If you don't have tha app store id you can create an url based on this documentation https://developer.apple.com/library/ios/qa/qa1633/_index.html

+ (NSURL *)appStoreURL
{
    static NSURL *appStoreURL;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        appStoreURL = [self appStoreURLFromBundleName:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"]];
    });
    return appStoreURL;
}

+ (NSURL *)appStoreURLFromBundleName:(NSString *)bundleName
{
    NSURL *appStoreURL = [NSURL URLWithString:[NSString stringWithFormat:@"itms-apps://itunes.com/app/%@", [self sanitizeAppStoreResourceSpecifier:bundleName]]];
    return appStoreURL;
}

+ (NSString *)sanitizeAppStoreResourceSpecifier:(NSString *)resourceSpecifier
{
    /*
     https://developer.apple.com/library/ios/qa/qa1633/_index.html
     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.
     */
    resourceSpecifier = [resourceSpecifier stringByReplacingOccurrencesOfString:@"&" withString:@"and"];
    resourceSpecifier = [[NSString alloc] initWithData:[resourceSpecifier dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES] encoding:NSASCIIStringEncoding];
    resourceSpecifier = [resourceSpecifier stringByReplacingOccurrencesOfString:@"[!¡\"#$%'()*+,-./:;<=>¿?@\\[\\]\\^_`{|}~\\s\\t\\n]" withString:@"" options:NSRegularExpressionSearch range:NSMakeRange(0, resourceSpecifier.length)];
    resourceSpecifier = [resourceSpecifier lowercaseString];
    return resourceSpecifier;
}

Passes this test

- (void)testAppStoreURLFromBundleName
{
    STAssertEqualObjects([AGApplicationHelper appStoreURLFromBundleName:@"Nuclear™"].absoluteString, @"itms-apps://itunes.com/app/nuclear", nil);
    STAssertEqualObjects([AGApplicationHelper appStoreURLFromBundleName:@"Magazine+"].absoluteString, @"itms-apps://itunes.com/app/magazine", nil);
    STAssertEqualObjects([AGApplicationHelper appStoreURLFromBundleName:@"Karl & CO"].absoluteString, @"itms-apps://itunes.com/app/karlandco", nil);
    STAssertEqualObjects([AGApplicationHelper appStoreURLFromBundleName:@"[Fluppy fuck]"].absoluteString, @"itms-apps://itunes.com/app/fluppyfuck", nil);
    STAssertEqualObjects([AGApplicationHelper appStoreURLFromBundleName:@"Pollos Hérmanos"].absoluteString, @"itms-apps://itunes.com/app/polloshermanos", nil);
    STAssertEqualObjects([AGApplicationHelper appStoreURLFromBundleName:@"Niños and niñas"].absoluteString, @"itms-apps://itunes.com/app/ninosandninas", nil);
    STAssertEqualObjects([AGApplicationHelper appStoreURLFromBundleName:@"Trond, MobizMag"].absoluteString, @"itms-apps://itunes.com/app/trondmobizmag", nil);
    STAssertEqualObjects([AGApplicationHelper appStoreURLFromBundleName:@"!__SPECIAL-PLIZES__!"].absoluteString, @"itms-apps://itunes.com/app/specialplizes", nil);
}
随波逐流 2024-07-17 19:51:55

这里的大多数解决方案都已经过时并且无法使用。 已弃用

对于那些寻找更新的工作解决方案的人来说,

// let appStoreLink = "https://apps.apple.com/app/{app-name}/{app-id}"

guard let url = URL(string: Constants.App.appStoreLink) else { return }
UIApplication.shared.open(url)

Most of the solutions here are outdated & deprecated

For those looking for the updated working solution

// let appStoreLink = "https://apps.apple.com/app/{app-name}/{app-id}"

guard let url = URL(string: Constants.App.appStoreLink) else { return }
UIApplication.shared.open(url)
浅语花开 2024-07-17 19:51:55

它将直接打开App Store

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

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

it will open the App Store directly

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

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:iTunesLink]];
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文