-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Location doesn't work on Android and iOS #16
Comments
@M-HARIS-97 interesting, this was working before. I'll try to take a look at it today. A full stacktrace from the android side would be helpful. |
@M-HARIS-97 , I just tested this in the Can you please pull the latest version of the project and see if you can reproduce it in the example app? I've added instructions on how to run the example app. You can test it by selecting one of the chapters from the table of contents. You can see that the navigator correctly navigates to the chapter. I'm going to close this until you figure out a repro in the example. |
@jspizziri Please check the following image. This is the problem I faced |
@M-HARIS-97 you need to describe to me how to reproduce the error in the example app. Have you tried that? |
@jspizziri My application has 2 screens. First is an epub file list screen and second is a readium reading screen. I select an epub file, flick through some pages and store the last page locator value in my local db (sqlite), then return to the listing page. I select the same book again, that time I retrieve the locator value from the local DB and pass the value to the location property. That time I got an error message which I shared earlier. |
@M-HARIS-97 , I don't want to sound like a jerk. I'll help you solve this, but you need to create a reproduction in the example app. The problem could be many things, including your ebook. If I can't see a reproduction I won't be able to fix it or help you. Do you have questions on how to set up a repro with the example? |
@jspizziri I was able to reproduce the problem using the example app. I made some changes to the example app. Please refer to the following to reproduce the issue; |
@M-HARIS-97 thanks for working on the repro. We need to take it a bit further. I want to eliminate all possible external variables from the equation, such as there being a problem in the way you're saving or fetching data to/from sqlite. Therefore, please create a reproducible example by just storing a locator value in JS and seeing if that causes the same problem (i.e remove sqlite from the example). I really need to know what the book and the locator actually look like at the time you're attempting to navigate. Additionally, if you're needing to make changes to the code to reproduce it, please fork the library, make the actual changes on your fork, and then send me a link to your fork with your changes in a comment. |
@jspizziri Please go through the following steps; 1 - Open the book. Flick some pages and console the locator value. After updating to the latest version 1.0.4 its not working on iOS too. |
@jspizziri I'm still facing this problem on iOS and android. Could you pleas verify this? Please check my last comment. |
@M-HARIS-97 upon opening the App you should be using In short, With all that said, I could see a potential need for a feature that reports the state of the views initialization process. Something like the following to help determine if you're allowed to start passing onStateChange={(state: 'loading' | 'initialized' | 'errored' ) => { ... }} |
@jspizziri Thanks for your detailed explanation. Currently it works well on iOS and android. Previously I was not using the initialLocation property. I think that's why I faced problems in my project. Once again Thank you @jspizziri for your unconditional help |
@M-HARIS-97 thanks for the bug reports! I should probably add something to the README.md to make it more clear to folks what that property is for. |
I've updated the readme for better clarity here dc92e1e |
@jspizziri Ok Noted |
Location doesn't work on Android. Always opens the first page. Locator props works fine.
<ReadiumView
file={{url: filePath}}
settings={settings}
location={{
href: '/EPUB/text/ch002.xhtml',
locations: {
position: 5,
progression: 0,
totalProgression: 0.024390243902439025,
},
type: 'application/xhtml+xml',
}}
onLocationChange={locator => locationChanged(locator)}
/>
Error: lateinit property navigator has not been initialized
The text was updated successfully, but these errors were encountered: