iPhone offline application with synchronization

后端 未结 5 1470
深忆病人
深忆病人 2021-01-29 23:52

I\'m looking into building an application which works just as well offline as it does online. Since the application cannot communicate with the server while in offline, there is

5条回答
  •  迷失自我
    2021-01-30 00:26

    there are plenty of application on the app store which rely on both online as well as offline data

    what you should really be doing is on start of your app, run a background thread (which runs silently so your user never sees any delay). this thread downloads the latest data from your server and pushes it into your local database (sqlite is the best choice)

    make sure you implement some kind of data versioning so that your app only downloads data which is actually changed since last download - else you would unnecessarily be downloading the entire dataset which can be quite huge (depending upon your app requirements)

    also make sure to test for internet connectivity when doing this. if no internet is available, alert the user for sure

    this way you get the best of both worlds. users when away from internet can still use your app with their local sqlite data

    in iphone os 3.0 apple has introduced push services - where you can simply "PUSH" your data instead of doing a "PULL" however this is not available in the current iPhone OS (2.x.x)

提交回复
热议问题