programing

앱스토어 앱 링크 방법

topblog 2023. 4. 18. 21:39
반응형

앱스토어 앱 링크 방법

나는 내 아이폰 게임의 무료 버전을 만들고 있다.앱스토어의 유료버전으로 이동하는 버튼이 프리버전에 있었으면 합니다.표준 링크를 사용하는 경우

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

iPhone은 Safari를 먼저 열고 앱스토어를 엽니다.앱스토어를 직접 여는 다른 앱을 사용해 봤기 때문에 가능한 것으로 알고 있습니다.

좋은 생각 있어요?앱스토어의 URL 스킴은 무엇입니까?

2016-02-02 편집

iOS 6부터는 SKStore ProductViewController 클래스가 도입되었습니다.앱을 종료하지 않고 앱을 링크할 수 있습니다.Swift 3.x/2.xObjective-C코드 조각이 여기에 있습니다.

SKStore ProductViewController 개체는 사용자가 앱 스토어에서 다른 미디어를 구입할 수 있는 저장소를 제공합니다.예를 들어, 사용자가 다른 앱을 구매할 수 있도록 앱에 스토어가 표시될 수 있습니다.


Apple Developers를 위한 뉴스발표에서.

iTunes 링크를 통해 앱스토어의 앱으로 직접 이동 iTunes 링크를 통해 웹 사이트 또는 마케팅 캠페인에서 앱스토어의 앱에 직접 쉽게 액세스할 수 있는 방법을 고객에게 제공할 수 있습니다.iTunes 링크를 만드는 것은 간단하며, 고객에게 단일 앱, 모든 앱 또는 회사 이름이 지정된 특정 앱으로 안내할 수 있습니다.

고객을 특정 애플리케이션으로 전송하려면 http://itunes.com/apps/appname

앱스토어에 있는 앱 목록으로 고객을 보내려면 http://itunes.com/apps/developername를 방문하십시오.

고객님의 회사명이 URL에 포함된 특정 앱으로 고객을 보내려면 http://itunes.com/apps/developername/appname를 방문하십시오.


기타 주의사항:

할 수 요.http://itms:// ★★★★★★★★★★★★★★★★★」itms-apps://츠키다

주의하시기 바랍니다.itms://사용자를 iTunes 스토어로 전송하고itms-apps://앱스토어에 보내드립니다!

명명 방법에 대한 자세한 내용은 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에서 항목 이름을 마우스 오른쪽 버튼으로 클릭하거나 컨트롤을 클릭한 다음 팝업 메뉴에서 "Copy iTunes Store URL"을 선택합니다.
  4. '''를 만듭니다.NSURLURL을 를 "iTunes URL"로 합니다.UIApplication의 ★★openURL: 앱스토어에서 아이템을 여는 방법.

샘플 코드:

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

스위프트 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)!)
    }

앱 스토어에 직접 앱을 열려면 다음을 사용해야 합니다.

itsms-http://...

이렇게 하면 먼저 iTunes로 이동하는 대신 기기에서 App Store 앱을 직접 열고 App Store만 엽니다(itms://).


편집: APR, 2017. itms-apps:// 실제로 iOS10에서 다시 작동합니다.시험해 봤어요.

편집: APR, 2013년 4월iOS5 이상에서는 더 이상 작동하지 않습니다.그냥 사용하다

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

리다이렉트는 없습니다.

iOS 6부터는 SKStore Product View Controller 클래스를 사용하여 올바르게 작업을 수행합니다.

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 항목 식별자는 다음과 같이 얻을 수 있습니다. (정적인 항목 대신)

스위프트 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")

목적-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 kAppITunesItemIdentifier (Itunes 항목 식별자) : (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]];

애플은 방금 appstore.com URL을 발표했다.

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

앱스토어 단축링크에는 iOS 앱용과 Mac 앱용 두 가지 형태가 있습니다.

회사명

iOS: http://appstore.com/ (예: http://appstore.com/apple

Mac: http://appstore.com/mac/ 등

응용 프로그램 이름

iOS: http://appstore.com/ (예: http://appstore.com/keynote

Mac: http://appstore.com/mac/ 등

회사별 앱

iOS: http://appstore.com/ / (예: http://appstore.com/apple/keynote )

Mac: http://appstore.com/mac/ / (예: http://appstore.com/mac/apple/keynote )

대부분의 회사와 앱은 표준 App Store Short Link를 가지고 있습니다.이 표준 URL은 특정 문자("&")를 변경하거나 삭제하여 작성됩니다.이 중 대부분은 잘못된 문자이거나 URL에 특별한 의미가 있습니다.

App Store Short Link를 만들려면 회사 또는 앱 이름에 다음 규칙을 적용합니다.

모든 공백 제거

모든 문자를 소문자로 변환

모든 저작권(©), 상표(™) 및 등록 마크(®) 기호 제거

앰퍼샌드("&")를 "and"로 바꿉니다.

대부분의 구두점을 삭제합니다(세트는 목록 2 참조).

악센트 문자 및 기타 "장식" 문자(ü, , 등)를 기본 문자(u, a 등)로 바꿉니다.

다른 모든 문자는 그대로 둡니다.

리스트 2 삭제할 필요가 있는 구두점 문자.

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

다음은 변환을 수행하는 예를 보여 주는 몇 가지 예입니다.

앱스토어

회사명의 예

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

Activision Publishing, Inc. => http://appstore.com/activisionpublishinginc

Chen's Photography & Software = > http://appstore.com/chensphotographyandsoftware

응용 프로그램 이름 예시

오카리나 => http://appstore.com/ocarina

마이 페리는 어딨어요?=> http://appstore.com/wheresmyperry

브레인 챌린지™=> http://appstore.com/brainchallenge

2015년 여름 이후는...

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

'id1234567890'을 'id' 및 'your 10 digit number'로 바꿉니다.

  1. 이것은 모든 디바이스에서 완벽하게 동작합니다.

  2. 리다이렉트 없이 앱스토어로 바로 이동합니다.

  3. 전국 모든 매장에서 사용 가능합니다.

  4. 확실히, 사용법을 바꾸어야 합니다. loadProductWithParameters그러나 링크의 목적이 실제로 사용하고 있는 앱을 갱신하는 것이라면, 이 「구식」의 어프로치를 사용하는 것이 좋을지도 모릅니다.

리다이렉트 없이 직접 링크를 설정하려면:

  1. Apple Services Marketing Tools : https://tools.applemediaservices.com/ 를 사용하여 실제 직접 링크를 이용하십시오.
  2. 「 「 」를 교환해 .https://itms-apps://
  3. 를 열어서 '열어요'를 눌러주세요.UIApplication.shared.open(url, options: [:])

이러한 링크는 시뮬레이터가 아닌 실제 장치에서만 작동합니다.

출처:

  • 코멘트 : 새로운 링크의 @rwcorbett에 크레딧을 부여합니다.
  • Apple 문서: https://developer.apple.com/library/ios/ #qa/qa2008/qa1629.http://https://developer.apple.com/library/ios/

이 코드는 iOS에서 앱 스토어 링크를 생성합니다.

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

앱 링크에서 'itunes'를 'phobos'로 변경하기만 하면 됩니다.

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

이제 앱스토어가 직접 열립니다.

APP ID 。

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

리다이렉트 수는 제로입니다.

많은 답변이 'itms' 또는 'itms-apps'를 사용할 것을 제안하지만, 이 방법은 애플이 특별히 권장하는 것은 아닙니다.앱스토어를 여는 방법은 다음과 같습니다.

리스트 1 iOS 응용 프로그램에서 앱 스토어 실행

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 은 、 은은은 。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에서 해결된 버그로 보입니다.

개발자의 앱에 링크하고 싶을 때 개발자의 이름에 구두점이나 공백(예: Development Company, LLC)이 있는 경우 다음과 같이 URL을 구성합니다.

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

그렇지 않으면 iOS 4.3.3에서 "이 요청을 처리할 수 없습니다"가 반환됩니다.

앱스토어 또는 iTunes의 특정 아이템에 대한 링크는 링크 메이커(http://itunes.apple.com/linkmaker/)를 통해 얻을 수 있습니다.

이것은 ios5에서 동작하며 직접 링크하고 있습니다.

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

모든 답변이 오래되어 작동하지 않습니다. 다음 방법을 사용하십시오.

「 」 「 」 。
itms-apps://apps.apple.com/developer/developer-name/developerId

「 」:
itms-apps://itunes.apple.com/app/appId

이는 앱스토어에서 다른 기존 애플리케이션을 수정/링크하는 간단하고 간단한 방법입니다.

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

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

Xcode 9.1 및 Swift 4의 경우:

  1. StoreKit 가져오기:
import 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(identifier: "here_put_your_App_id")

주의:

앱의 ID를 정확하게 입력하는 것이 매우 중요합니다.이로 인해 에러가 발생하기 때문입니다(에러 로그는 표시되지 않지만, 이 때문에 정상적으로 동작하는 것은 없습니다).

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

효과가 있다

애플은 https://apps.apple.com/app/id1445530088 또는 https://apps.apple.com/app/ {your_app_id}의 새로운 링크를 제공했다고 생각합니다.

여러 OS 및 여러 플랫폼을 지원하는 경우 링크 작성은 복잡한 문제가 될 수 있습니다.예를 들어 WebObjects는 iOS 7(일부 링크)에서 지원되지 않으며, 사용자가 만든 링크 중 일부는 사용자의 국가 스토어 외에 다른 국가 스토어를 엽니다.

iLink라는 오픈 소스 라이브러리가 있습니다.

이 라이브러리의 장점은 실행링크를 찾아 생성할 수 있다는 입니다(라이브러리는 앱 ID와 실행 중인 OS를 확인하고 어떤 링크를 만들어야 하는지 파악합니다).여기서 가장 좋은 점은 사용하기 전에 거의 모든 것을 설정할 필요가 없다는 것입니다.이것에 의해, 에러가 발생하지 않고, 항상 동작합니다.같은 프로젝트에 타겟이 적기 때문에 어떤 앱 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 를 같은 파일에 Import 하는 것을 잊지 말아 주세요.

라이브러리 전체에 대한 매우 좋은 문서와 iPhone 및 Mac용 프로젝트 예가 있습니다.

iOS 9 이상

  • 앱스토어에서 직접 열기

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

개발자 앱 목록

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

Apple의 최신 문서에 따르면 다음을 사용해야 합니다.

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

또는

SKStoreProductViewController 

여기에는 많은 답변이 있지만 개발자 앱에 링크하기 위한 제안은 더 이상 작동하지 않는 것 같습니다.

마지막으로 방문했을 때 다음 형식으로 작업을 수행할 수 있었습니다.

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

이 작업은 더 이상 작동하지 않지만 개발자 이름을 삭제하면 다음과 같은 작업을 수행할 수 있습니다.

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

앱스토어 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);
}

앱스토어를 직접 엽니다.

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

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

이 솔루션의 대부분은 시대에 뒤떨어져 권장되지 않는다.

최신의 실전 솔루션을 찾고 있는 분

// 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)

이쪽을 시험해봐.

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입니다.이 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]];

감사해요.

스위프트에서UI - 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()
    }
}

언급URL : https://stackoverflow.com/questions/433907/how-to-link-to-apps-on-the-app-store

반응형