Will iOS region monitoring call didEnterRegion on my app if my app is in a terminated state?

那年仲夏 提交于 2019-11-26 14:37:32

问题


Will iOS region monitoring launch my app in the background if the user enters a region that was successfully being monitored for prior to the app being terminated?

I know that the significant change API will do so and will let me know at launch time via the inclusion of the UIApplicationLaunchOptionsLocationKey key. If region monitoring will wake my app up out of a terminated state too, then what does the launch process look like? Is there a special key I should be looking for?


回答1:


Yes, see Region Monitoring

In iOS, regions associated with your app are tracked at all times, including when your app is not running. If a region boundary is crossed while an app is not running, that app is relaunched into the background to handle the event. Similarly, if the app is suspended when the event occurs, it is woken up and given a short amount of time (around 10 seconds) to handle the event.




回答2:


I have been searching for similar answer, but came across this: Region monitoring in ios 7

Seems like if the app is manually terminated by the user in iOS 7, location notifications will not wake the app to process it. Apple employee has commented here https://devforums.apple.com/thread/209302?tstart=0



来源:https://stackoverflow.com/questions/19850088/will-ios-region-monitoring-call-didenterregion-on-my-app-if-my-app-is-in-a-termi

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