IOS 7 SKStoreProductViewController Cannot Connect to iTunes Store

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

Produces an error Cannot connect to iTunes Storeon iOS7.

+4
source share

All Articles