Skip to content

Minimum code to load and display an epub #332

Answered by mickael-menu
Noah-Barsky asked this question in Q&A
Discussion options

You must be logged in to vote

It's crashing because you are force-unwrapping the publication optional when it's not yet set.

You need to first open the publication with the streamer, and then create a fragment factory from it. Usually you would:

  1. Open the Publication with the streamer in a bookshelf activity.
  2. Store the Publication object in a shared store (see ReaderRepository in the test app)
  3. Get the publication from the shared store when creating the reader activity, to initialize the fragment factory.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@paulocoutinhox
Comment options

Answer selected by Noah-Barsky
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants