Meteor android app login while offline

218 views Asked by At

I am trying to build a Meteor app (intended to be used mainly as an Android mobile app - not from a browser) that will be functional even if user gets offline. For that reason, I am using Grounddb package.

If I login to my app while connected to the internet, everything works as expected. Everything keeps working as expected even if user loses internet connection while he is inside the app. The problems begin if user closes the app, and reopens it (while offline).

After debugging, I figured out that on app startup, in Accounts package if autologin is enabled (which somehow is), loginWithToken method is called. Meteor loginToken exists in local storage, as well as user exists in local db. Method call fails as we are offline, I guess.

I am relatively new to Meteor and I really don't know how to handle this. Should I disable autologin? How can I do this? Can I somehow make the app use local db for user authentication/authorization? I have found plenty of similar questions online, but couldn't find any answer.

0

There are 0 answers