How long does “location updates” process can run in background?

故事扮演 提交于 2020-01-06 07:04:41

问题


Assumes that I registered "location updates" service. If the location changes significantly, the callback function gets invoked.

Question: How long is my function allowed to run in the background? Let's say the function does so much work and need 10 minutes to finish, will it be terminated by system? I guess Apple won't allow long-run job in location-updates-callback. But I couldn't find the official explanation. Could anyone help? thanks a lot.

https://developer.apple.com/library/content/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/BackgroundExecution/BackgroundExecution.html


回答1:


Your app will receive location updates till it stays in background. There's a chance that your app would go inactive when other active apps require memory. In this case, your app will stop receiving location updates. There's no fixed background execution time mentioned anywhere in Apple's documentation. It may be possible that your app can receive location updates for more than 10 minutes but only if it stays in background.



来源:https://stackoverflow.com/questions/46075103/how-long-does-location-updates-process-can-run-in-background

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