我正在尝试使用以下代码通过我的 iPhone 应用程序打开 iBook:
- (void)goToiBookStore {
NSURL *url = [NSURL URLWithString:@"itms-books://itunes.apple.com/us/book/le-secret-du-poids/id711921224"];
//NSURL *url = [NSURL URLWithString:@"itms-bookss://itunes.apple.com/us/book/le-secret-du-poids/id711921224"]; // Also tried
//NSURL *url = [NSURL URLWithString:@"https://itunes.apple.com/us/book/le-secret-du-poids/id711921224?l=fr&ls=1"]; // Also tried
// On teste si iBook installed
if ([[UIApplication sharedApplication] canOpenURL:url]) {
[[UIApplication sharedApplication] openURL:url];
}
else {
[[[UIAlertView alloc] initWithTitle:@"iBooks" message:NSLocalizedString(@"installer ibooks lab", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"annuler", nil) otherButtonTitles:NSLocalizedString(@"installer", nil), nil] show];
}
}
但是,URL 没有将我发送到 iBooks 中的 iBook,而是发送到下载页面,这正常吗?