Answered: how to an app work offline and store data without authentication
Answered: how to an app work offline and store data without authentication
hi,
I have an app called "TodoList" with follow functionalites:
- Login/registration to sencha touch
- Create new task and list todo tasks.
I user senchaio to register (username/password/email) and login then...I can sync data in different devices with condition is the app has to have network available. If not, user that i registered earlier will not be able to login (authenticate) .....
So please tell me how to store data without authenticate and login in offline. Then go online again, data can sync together.
> But how can i authenticate user login without network online. User can only create new task if you login successful. Or when user registrations with sencha io, does local storage of sencha touch save user information?
You can't authenticate a user when the device is offline. But, once the user has authenticated (and not logged out) the client remembers the user's identify. So yes it's in local storage.
Also, you can create and use a sync store before the user has authenticated. It's only when the client connects and tries to sync the data store that we need the user to authenticate themselves.
You can write to your local sync store even when you are offline. If the user is not authenticated then sync with the remote servers will not work, when the device is online and the user has authenticated themselves then it will work.
Thanks for your share.
But how can i authenticate user login without network online. User can only create new task if you login successful. Or when user registrations with sencha io, does local storage of sencha touch save user information?
I am so confused about that.
> But how can i authenticate user login without network online. User can only create new task if you login successful. Or when user registrations with sencha io, does local storage of sencha touch save user information?
You can't authenticate a user when the device is offline. But, once the user has authenticated (and not logged out) the client remembers the user's identify. So yes it's in local storage.
Also, you can create and use a sync store before the user has authenticated. It's only when the client connects and tries to sync the data store that we need the user to authenticate themselves.