jepiqueau / react-sqlite-app-starter

Ionic/React SQLite Application Starter
MIT License
22 stars 14 forks source link

Is this project work in offline mode #5

Closed jpnathannew closed 4 years ago

jpnathannew commented 4 years ago

Hi Team,

i am planning to create a APP using IONIC and React. My APP should work in Online as well as offline also. Is it possible to achieve by using sqllite?

If yes please guide me how it will work on mobile. Help me ...

jepiqueau commented 4 years ago

@jpnathannew the sqlite plugin to generate databases on the device so its doesn't need to be Online. Now if you want to use it in combination with databases residing on a server, your application has to manage the request to the server and synchronize through the importFromJson method when you are in Online mode and then you can work Offline make queries add new data to the tables and then when you are back Online, your app can use the exportToJson method to get the modification since the last synchronization date and then your application should use the Json object return to synchronize back to the server through http requests. When this is completed successfully you have to update the synchronization date on the device. hope this will be helpful.