What exactly can CoreBluetooth applications do whilst in the background?

后端 未结 4 942
清酒与你
清酒与你 2020-11-29 15:30

The subject says it all, really. Documentation, insofar as it exists at all, suggests that apps written against the CoreBluetooth framework running on iOS devices can add \"

4条回答
  •  离开以前
    2020-11-29 15:51

    I've just learnt background mode for BLE devices on iOS8.3 & 8.4 and have found some differences from above:

    1. if I start

      [centralManager scanForPeripheralsWithServices:@[[CBUUID UUIDWithString:kServiceUUID]] options:@{CBCentralManagerScanOptionAllowDuplicatesKey : @YES }];

    from

    - (void)applicationDidEnterBackground:(UIApplication *)application
    

    I found enumeration returns the same device every call with different RSSI, so CBCentralManagerScanOptionAllowDuplicatesKey isn't ignored.

    1. If app is in foreground it discovered BLE device 50 times in sec. If app is in background but the phone screen is active app discovered BLE devices 6times in sec. If phone screen is blocked app discovered BLE devices 1time in sec.

提交回复
热议问题