I need to create offline module that will store all my requests and then when Internet connection will be available the module will make request one by one to the server.
Right now I am working with Core Data and AFNetworking 2.0, but I am working online. So the online algorithm is next:
But offline algorithm has a small different:
The main thing unique identifier and relationships which need to update after temp object will synchronized with the object on the backend.
My question is there already made solution how to sync offline data with the server?
Or maybe you have better algorithm it is also ok for me )
How offline sync works. Your client code controls when local changes are synchronized with a data sync service. Nothing is sent to the service until there you push local changes. Similarly, the local store is populated with new data only when you pull data.
I would suggest the following flow:
Before activating the manager, you could query the store for pending requests and cancel/delete the ones that are no longer relevant.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With