2013-02-18 78 views
1

我的BLE应用程序在后台运行并扫描外围设备,但委托方法centralManager:didDiscoverPeripheral:advertisementData:RSSI:未回调。我已经在Info.plist中设置了UIBackgroundModes的值。为什么?如何解决它?在背景上扫描外围设备

+0

这是因为[这里]同样的问题(http://stackoverflow.com/questions/21749580/never -seen-任何功能于corebluetooth框架 - 关于保管最连接aliv/22251385#22251385)。 – hlnd 2014-03-07 13:33:48

回答

0

您不能在后台模式下扫描外设, 只是打开与外设的连接并保持对该外设的引用。

,您可以调用

[peripheral1 readRSSI]; 

,并等待回调CBPeripheralDelegate后

peripheralDidUpdateRSSI: