Skip to content
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

Can we set the specific location #183

Open
Mubeen07 opened this issue Sep 7, 2020 · 2 comments
Open

Can we set the specific location #183

Mubeen07 opened this issue Sep 7, 2020 · 2 comments

Comments

@Mubeen07
Copy link

Mubeen07 commented Sep 7, 2020

Can we set the location to specific page to navigate, Like if I'm reading a book and want to resume from that location where I left and when reopen the app

@ErnestGrey
Copy link

The onLocationChange prop will return the the most recent location. Then you can store that location in AsyncStorage or wherever else then ask for it back when the view is rendered.

@mesismart
Copy link

hi

save start cfi like this in onLocationChange:

  onLocationChange={(visibleLocation) => {

for save cfi :

visibleLocation.start.cfi

than in onReady get cfi from async storage and set state location

    AsyncStorage.getItem(id.toString())
                            .then(value => {
                                if (value != null && value.length > 5) {
                                    console.log("saved cfi: " + value);
                                    this.setState({ location: value, });

                                }
                                // else
                                // this.setState({ "islogin": false });
                            })
                            .done();

set location={this.state.location} For Epub

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants