2

Already I built an iOS application that pull json data from a server(PHP MySQL), now i need to change this architecture to this schema to make my application work online/offline : enter image description here

there is any suggestion for solution for Auto Sync ?

1
  • Good luck. Syncing means drinking. Two-way syncing is a complex problem, and the answers depend on many details of how your app works and what kind of data you have. Commented Mar 9, 2016 at 19:25

1 Answer 1

1

Basically you need to follow the steps :

  1. Upon starting up, application:didFinishLaunchingWithOptions: you need to check for your internet connection. If not available, inform the user to enable it.
  2. After registering an internet connection you need to connect to your server and retrieve the json and map it to the database model. I suggest you use JSONModel to parse the json and MagicalRecord to easily save that data to your database.

That would solve all your needs for auto-sync.

Sign up to request clarification or add additional context in comments.

2 Comments

thanks but i need to allow users to work with the application whene there is no connection or slow connection, and auto sync data whene internet comes back like auto sync with couchbase lite
then just register for notifications when the user connects to the internet with stackoverflow.com/a/3597085/1889814 and sync then.. -(void) checkNetworkStatus:(NSNotification *)notice ...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.