2

I am developing an application that could have a potential companion reference in the form of an ePub/PDF/iBook. There's a scheme for opening iBooks from your application, but is there a known way to open a specific book (not import the book, rather open an existing book in the app)? Bonus points: open a specific location in the given ePub/PDF/iBook?

I have scoured Google looking for this answer but only turn up the scheme: only one piece of the puzzle.

Wayne Hartman
  • 18,369
  • 7
  • 84
  • 116

1 Answers1

0

Swift 3

From the iBooks Author support :

To link to another book in iBooks, you need to know the book’s asset ID. Find a book’s asset ID by going to its iTunes Preview webpage and checking the number in its URL. For example, in the URL https://itunes.apple.com/us/book/e.-o.-wilsons-life-on-earth/id888107968?mt=13, the asset ID is 888107968. A link to this book would be ibooks://assetid/888107968.

One could implement it as such :

let stringURL = "ibooks://assetid/1219117996"
let url = URL(string:stringURL)
UIApplication.shared.open(url!, options: [:], completionHandler: nil)

I have yet to find a way to link to an iBook the user has manually imported.

Alexandre G.
  • 1,781
  • 14
  • 17