在 foreground/background 中从其他 BLE 设备扫描的后台广告外围设备

The background advertised peripheral to be scanned from other BLE devices either in foreground/background

我正在与 iOSBLE 合作,我可以在其中同时建立外围广告和扫描。

我有 2 台设备,它们会同时扫描广告,当设备处于前台时它工作正常。

现在的问题是:设备处于后台,这意味着广告不起作用(无法显示本地名称和 UUID,因为它会按照 Apple 进行屏蔽)因为根据 Apple Docs: advertisement key are placed in a special “overflow” area; they can be discovered only by an iOS device that is explicitly scanning for them.

现在我的问题是如何扫描这个溢出区域?

另请注意,当设备在后台播放广告时,我也不会在下面的代表中收到回电: - (void)centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)peripheral advertisementData:(NSDictionary<NSString *, id> *)advertisementData RSSI:(NSNumber *)RSSI;

任何可能的方法我都可以做这个方法,这真的很有帮助。

上述情况的解决方案如@Paulw11 所述。 我们只需要扫描特定的外设 ID。 感谢 Paulw11