gpt4 book ai didi

iphone - didEnterRegion 当应用程序未运行时

转载 作者:行者123 更新时间:2023-11-28 22:41:31 24 4
gpt4 key购买 nike

iOS5。我已经正确设置了 CLLocationManager,它会监听区域进入/退出。一切正常。但是当我终止我的应用程序并进入一个区域时,我收到了一个本地通知(在 didEnterRegion 方法中定义)并且它再次启动了我的应用程序。这是标准行为还是有其他事情发生?我以为它会在后台启动应用程序,执行 didEnterRegion: 并在一段时间后再次杀死自己。我需要做的就是在 didEnterRegion 中进行 HTTP 调用:

有谁遇到过类似的事情吗?

最佳答案

这是预期的行为。当您的应用程序未运行但已为您的应用程序注册地理围栏过境点时,它将启动并触发回调。之后它不会被杀死,除非系统决定,它需要内存。

别担心,您的应用程序即使已经启动也会处于休眠状态,因此不会有速度/电池/等方面的损失。

查看文档:

Handling Boundary-Crossing Events for a Region

Every time the user’s current location crosses a boundary region, the system generates an appropriate region event for your app. If your app is already running, these events go directly to the delegates of any current location manager objects. If your app is not running, the system launches it in the background so that it can respond. Apps can implement the following methods to handle boundary crossings:

关于iphone - didEnterRegion 当应用程序未运行时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14404355/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com