Background sync in iOS7

≡放荡痞女 提交于 2019-12-07 04:23:15

问题


We have to develop an app which will support data sync operations at some time interval, whether the app is in foreground or in background.

I want to know that in iOS7…

  • is it possible to sync data (i.e. call web services) while the app is in background?
  • can we access SQLite data base file/can we do DB operations while the app is in background?
  • can we run timers in background?
  • can we show alerts about some updates while the app is in background?

Thanks in advance.


回答1:


  1. Yes, it is.
  2. Yes, you can.
  3. Sometimes, but you shouldn't.
  4. Yes, you can.

Go and research iOS 7 background operations. Talk of using timers and background operations at some time interval indicate you're approaching the problem in a way that won't work. While the answer to most of your questions is yes, your approach is probably no...

Start with application:performFetchWithCompletionHandler:.



来源:https://stackoverflow.com/questions/21600955/background-sync-in-ios7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!