【发布时间】:2017-04-21 21:56:58
【问题描述】:
我正在尝试在后台扫描 BLE 设备,但我的 didDiscoverPeripheral 方法没有被调用。我已经等了 5 分钟,但什么也没发生,但是当我打开其他蓝牙应用程序(如“LightBlue”)时,我的 didDiscoverPeripheral 立即被调用。每次都会发生这种情况。如何在不运行 LightBlue 的情况下完成这项工作?
这是我的扫描代码:
central.scanForPeripherals(withServices: [cbuuid], options: nil)
项目具有正确的后台设置,因为在启动 LightBlue 后 didDiscoverPeripheral 正在后台工作。
【问题讨论】:
标签: ios swift bluetooth-lowenergy core-bluetooth