I'm currently working on a React Native application, the server is already implemented and my app should implement offline sync, I'm planning to integrate realm
on the mobile device to deal with the offline data and pushing the data to the implemented server when the device is online. How would I go about doing that?
Asked
Active
Viewed 188 times
0

Sean Urgel
- 1
- 1
1 Answers
0
I'm trying also to make some kind of offline sync. A calendar app that works offline.
I'm developing it on ionic 4 using sqlite.
Basically, what I did is: I keep a variable with my last update timestamp.
Part 1
Get activities.
A service is running on the background, getting from the backend activities that their creation timestamp is later than the mobile last update timestamp.
Part 2
Every time the user create an activity I add the timestamp
to the activities table and a flag called synced
that is true
/ false
.
Another service scans the table for synced === 'false'
and does the POST
request.
Hope I helped.

marc_s
- 732,580
- 175
- 1,330
- 1,459

Tasos Kakouris
- 169
- 1
- 8