*使用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];
}
當你得到適當的鏈接,然後使用鏈接來打開應用
試試這個https://itunes.apple。 COM /中/應用程序/ YourAppName/id534438314?MT = 8。可能會根據日本 – PiyushRathi
更改'感謝您的及時回覆。這是iTunes應用程序本身的URL。但我只想訪問該應用的iTunes API –