iOS monitor user location in background.

孤街浪徒 提交于 2019-12-25 18:23:52

问题


I have read a number of posts here that it is possible to get location updates while the application is in the background.

My question is what to what extent can I do computing in the background and would I handle it as I would any other code, i.e. just a method call, etc.

Thanks a lot.


回答1:


It is possible, yes. You set the 'location' UIBackgroundModes flag in your Info.plist and then call the Location Manager.

See App States and Multitasking

You can do computing while your application is running in the background, although you run the risk of running down the device battery. It's better to just respond to location events.




回答2:


The Apple documentation is pretty clear about what your app can do while in the background. You cannot do whatever you want while your app is in the background -- there are only a few things you can do (i.e. play audio, track a users location, etc).

Check out Background Execution and Multitasking.



来源:https://stackoverflow.com/questions/10558569/ios-monitor-user-location-in-background

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