ios - 当设备已经在 Beacon 范围内时无法检测到 Beacon 然后我们打开蓝牙 & 应用程序被杀死

标签 ios objective-c bluetooth ibeacon clbeaconregion

我已经实现了带有本地通知的 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/

相关文章:

iphone - 从 ARM 动态库(框架)获取参数列表?

objective-c - 从 Objective-C (Cocoa) 中的另一个类调用类方法

objective-c - 使用 "unsigned char"指向原始数据缓冲区时需要了解内存管理

android - 在 Android 上处理蓝牙耳机点击(ACTION_VOICE_COMMAND 和 ACTION_WEB_SEARCH)

android - 在android上获取蓝牙网络共享设备的IP地址

ios - 仅当使用 RxBluetoothKit 连接成功时才延长蓝牙连接超时

objective-c - 处理第三方 API 时,正确的系统设计是什么?

android - Unity 突然 FPS 下降

iOS TodayView 小部件断点不起作用

ios - 如何在 iOS 上通过 bundle id 打开应用程序