且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

通过iBeacon Monitoring& amp; amp; amp; amp; Ranging vs CoreBluetooth scanForPeripheralsWithServices

更新时间:2022-04-23 23:29:59

您的描述大多正确。只需两个澄清:

You are mostly right with your description. Just two clarifications:


  • 每个设备的20个区域限制,它是特定于应用的。无论其他应用在移动设备上做什么,您的应用仍然可以通过iOS监控多达20个地区。也就是说,可能存在硬件限制,这些限制是特定于设备的,可以通过硬件辅助在后台监控多少个区域。这些限制没有记录。如果超过这些未记录的限制,则在后台检测到的信标可能需要更长的时间。 (尽管如此,无论如何都没有操作系统保证检测何时到来。)

  • The 20 region limit is not per device, it is app-specific. No matter what other apps are doing on the mobile device, your app is still allowed to monitor up to 20 regions by iOS. That said, there are likely hardware limits that are device-specific on how many regions can be monitored in the background with hardware assistance. These limits are undocumented. If you surpass these undocumented limits, it will probably take a lot longer to detected beacons in the background. (Although that said, there is no OS guarantee of when the detections come, anyway.)

您无法连接到 CLBeacon 使用监控和范围API。这些API仅适用于无连接的BLE广告包。

You cannot connect to a CLBeacon using Monitoring and Ranging APIs. These APIs only work with BLE advertising packets, which are connectionless.

是的,可以使用 scanForPeripheralsWithServices 作为替代方案。这就是Gimbal信标为实现专有系统所做的事情。然而,在背景检测时间和可靠性方面存在实际缺点。

Yes, it is possible to use scanForPeripheralsWithServices as an alternative. This is what Gimbal beacons do in order to implement a proprietary system. There are real disadvantages, however, in terms of background detection time and reliability.