Is it possible to run a task periodically in Background - iOS 4

非 Y 不嫁゛ 提交于 2019-12-03 23:30:08

问题


I want to poll the location from GPS in the background. So we used a NSTimer and performed periodic checks in the timer tick. In other words, can we schedule NSTimer while the app is in Background?

Thanks in advance


回答1:


You can't periodically execute arbitrary code, but you can get pinged on significant location changes via startMonitoringSignificantLocationChanges in CLLocationManager.



来源:https://stackoverflow.com/questions/3574248/is-it-possible-to-run-a-task-periodically-in-background-ios-4

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