iOS monitor user location in background.

2019-08-29 12:11发布

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.

2条回答
我欲成王,谁敢阻挡
2楼-- · 2019-08-29 12:54

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.

查看更多
▲ chillily
3楼-- · 2019-08-29 12:55

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.

查看更多
登录 后发表回答