我已经实现了带有本地通知的 Beacon。 当蓝牙处于开启状态然后设备进入信标范围并且应用程序处于“未运行”状态时,一切正常。 但是,当设备已经在 Beacon 范围内并且蓝牙打开时,不会调用任何委托(delegate)。这是限制还是我遗漏了什么?
最佳答案
这是 Core Location 框架的一个限制。
当应用程序终止“未运行”状态时,它可以由于位置管理器区域 didEnter/didExit 区域事件而重新启动。如果您在应用程序终止时打开和关闭蓝牙,您的位置管理器将不会收到区域进入/退出事件。您能够触发 didEnter/didExit 事件的唯一方法是通过超过其检测阈值物理进入或退出您的信标区域之一。
- 终止的应用程序将在区域 didEnter/didExit 事件上唤醒。
The region monitoring service delivers events normally while an app is running in the foreground or background. (You can use this service for both geographic and beacon regions.) For a terminated iOS app, this service relaunches the app to deliver events.
- 信标测距不会唤醒您的应用。
(If the beacon region’s notifyEntryStateOnDisplay property is true, waking the device causes the app to range for beacons for a few seconds in the background.) This service does not relaunch iOS apps that have been terminated; however, you can be relaunched by monitoring beacon regions using the region monitoring service.
关于ios - 当设备已经在 Beacon 范围内时无法检测到 Beacon 然后我们打开蓝牙 & 应用程序被杀死,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38520955/