HASNI Faiçal
HASNI Faiçal

Reputation: 260

Auto sync iOS application (Objective-C) local database with MySQL database

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 ?

Upvotes: 2

Views: 984

Answers (1)

VAO
VAO

Reputation: 1126

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.

Upvotes: 1

Related Questions