【发布时间】:2017-10-30 11:10:47
【问题描述】:
iOS 11:当 App 在后台 CBCentralManager 委托方法 didDiscoverPeripheral、didConnectPeripheral、didFailToConnectPeripheral、didDisconnectPeripheral 未调用时。
【问题讨论】:
-
请出示您的代码
-
myCentralManager = [[CBCentralManager alloc] initWithDelegate:self queue:dispatch_get_global_queue(QOS_CLASS_BACKGROUND, 0)]; - (void)centralManagerDidUpdateState:(CBCentralManager *)central { if (central.state == CBCentralManagerStatePoweredOn){ NSLog(@"BLE ON"); [myCentralManager scanForPeripheralsWithServices:nil options:@{ CBCentralManagerScanOptionAllowDuplicatesKey : @YES }]; } }
-
请编辑您的问题以包含您的代码,格式正确。请注意,您不能在后台使用重复项扫描键。
标签: ios objective-c bluetooth-lowenergy core-bluetooth