gpt4 book ai didi

ios - 在 iBooks 阅读器中打开一本书

转载 作者:行者123 更新时间:2023-11-29 13:04:29 27 4
gpt4 key购买 nike

我正在尝试使用以下代码通过我的 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,而是转到了下载页面,这正常吗?

http://img4.hostingpics.net/thumbs/mini_953506photo.png

最佳答案

您可以打开 iBooks,或打开该产品的商店,但不能直接打开一本书。

如果你想打开 iBooks:

NSString *stringURL = @"ibooks://";
NSURL *url = [NSURL URLWithString:stringURL];
[[UIApplication sharedApplication] openURL:url];

2019 年更新:您现在可以通过包含要打开的图书的 assetid 来打开特定图书的 iBooks。示例:

ibooks://assetid/1396541327

有关详细信息,请访问 Apple.com 网站 - https://support.apple.com/en-us/HT202929

关于ios - 在 iBooks 阅读器中打开一本书,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18980033/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com