I have an app that saves data on coredata, creates an entry on the “entity”, saving the data on the appropriate properties, and then sends the data to json to be saved in mysql using php on the server side,
data n1 (x1, x2, x3)....the variables coredata n1 (x1, x2, x3).....variables stored in coredata mysql n1 (x1,x2,x3).....variables stored in mysql (via json)
is working fine, but what would be the best way to send the data to the server for synchronization in case the internet connection is not available?
what I mean is, if the data could not be sent to mysql, in one of the savings to the coredata,
what is the best way to synchronize that data that wasnt sent?
thank you
hope my question makes sense,
please tell me what to clarify??
thanks a lot!
I your app delegate where you test for reachAbility if you have internet connection create an new thread and in this thread test is your data is synced or not. If not start to sync data.
To test you need to add an flag in your core Data that will keep the status of your sync.