sqlite - Receive update from web server to iOS App and synchronize data -


i'm writing app manage sqlite database, , have write web server, want user register in web server username , password, know how make request ios app server , receive response, want enable synchronization of sqlite database other device, core data can use icloud synchronization, prefer use sqlite, , find way synchronize it, example want create this:

  1. make change in sqlite in iphone app;
  2. the app send change server user;
  3. then server have send update other device connected @ user;

and can't go over, how server can send change other device? device has listen server? or there way send update directly device , handle it? apple push notification?

edit: if it's possible use apple push notification this, doesn't want alert text sound , badge user, send "silent notification" it's possible?

as high-level there few different ways approach this, of have pros , cons. 2 name 2 examples can polling method, active push or hybrid approach.

polling: @ pre-determined interval app tries "phone home" , send delta db changes server. here know server expecting x number of responses in given interval can appropriately gauge load.

active push: user decides when want changes transmitted server hitting "sync" button. allows user push data server when know there's change on zealous user may make change, upload, make change, upload, etc instead of queueing bunch of changes , sending them @ once. may create unneeded server calls.

hybrid: setup polling schedule within app , give user ability sync at-will in event there critical change needs made asap.

regarding listener side of equation face similar challenge conceptually. if original user makes 20 changes , presses sync 20 times bombard second user's device 20 times or queue changes , send them down every 5 minutes (as example)? unless have both devices paired each other or connected same network , visible each other via app you're going need leverage back-end server. push notifications can useful in manner there development , setup overhead take account implement them.

to boil down recommend laying out want syncing model before start marching down path.


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

php - joomla get content in onBeforeCompileHead function -