手机的蓝牙没打开,然后我的app被background的了,但是我设置了app可以在background运行,并且manager在scanning。此时我打开设置去将蓝牙打开,但是app在background不能自动匹配蓝牙设备。我调试了下,开关蓝牙的时候,程序会进入centralManagerDidUpdateState,在centralManagerDidUpdateState中我写了[self.manager scanForPeripheralsWithServices:nil
options:nil];
但是却不能进入- (void)centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)peripheral advertisementData:(NSDictionary *)advertisementData RSSI:(NSNumber *)RSSI
我拿饿了么的app测试过,饿了么的app在background的情况下,然后打开设置去开启蓝牙,这时候蓝牙信号指示那边会自动显示已经连上之前连的信号。。
但是我的app在后台不能自动连,非要active以后才会自动连。