【问题标题】:Unable to find an app using iTunes api无法使用 iTunes api 找到应用程序
【发布时间】:2016-12-19 10:20:12
【问题描述】:

我有一个 trackId 534438314。我正在使用 iTunes api 来获取有关此应用程序的信息。但我无法找到应用程序的详细信息。以下是我尝试过的:

  1. 我尝试在没有任何额外参数的情况下使用 iTunes api

    https://itunes.apple.com/lookup?id=534438314

它给出 0 个结果

  1. 我知道这个应用在日本商店有售,所以我添加了国家参数并尝试了以下网址

https://itunes.apple.com/lookup?id=534438314&country=jp

它给出 0 个结果

  1. 我还尝试使用带有和不带有国家/地区参数的 bundleId。这两种情况的结果计数均为 0。

https://itunes.apple.com/lookup?bundleId=net.appbank.maobank

我对此感到困惑,无法继续进行。任何帮助将非常感激。提前致谢。

【问题讨论】:

标签: ios itunes itunes-store itunes-api


【解决方案1】:

*首先使用 SKStoreProductViewController 类获取正确的链接。**

static NSInteger const kAppITunesItemIdentifier = 534438314;
[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];
}

获得正确链接后,使用该链接打开您的应用

【讨论】:

    猜你喜欢
    • 2017-09-01
    • 1970-01-01
    • 1970-01-01
    • 2011-04-29
    • 1970-01-01
    • 2023-03-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多