iOS 7 SKStoreProductViewController无法连接到iTunes Store

时间:2014-01-03 03:06:11

标签: ios7

if (NSClassFromString(@"SKStoreProductViewController")) {

    SKStoreProductViewController *storeProductVC = [[SKStoreProductViewController alloc] init];

    storeProductVC.delegate = self;

    NSDictionary *dict = [NSDictionary dictionaryWithObject:app_id 
    forKey:SKStoreProductParameterITunesItemIdentifier];


    [storeProductVC loadProductWithParameters:dict completionBlock:^(BOOL result, NSError *error) {

        if (result) {

            [self presentViewController:storeProductVC animated:YES completion:nil];
        }

    }];

}else{

    NSString *iTunesLink =[NSString stringWithFormat:@"http://itunes.apple.com/app/id%@?mt=8",appId];

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

在iOS7上生成错误Cannot connect to iTunes Store

0 个答案:

没有答案