kaushikgodhani / vocsy_epub_viewer

Apache License 2.0
29 stars 68 forks source link

Listener not working on android #18

Closed chitraarasu closed 1 year ago

chitraarasu commented 1 year ago

VocsyEpub.locatorStream.listen((locator) { print(locator); if (int.parse(locator) >= 5) { VocsyEpub.closeReader(); } });

Close reader function not exist in package so I added that function. This listener only works on IOS not working on Android. What is the issue?

vocsygautam commented 1 year ago

in which version, you are testing package ?

chitraarasu commented 1 year ago

1.0.1

chitraarasu commented 1 year ago

In ios listener prints the chapter number while scrolling the epub. but in android prints like this when a user closes the epub viewer

I/flutter (12703): LOCATOR: {"bookId":"urn:uuid:ba1e1afc-defb-458d-b13b-b21f4e93d12a","href":"/OEBPS/Text/The_Racketeer_split_006.html","created":1670904297508,"locations":{"cfi":"epubcfi(/0!/4/2[filepos38088])"},"title":""}

I want to restrict the users to read only the first chapter of the book. I want to listen to chapter number as it works for ios. In android, the listener works a different way. do you have any solution for this?