I have been developing an app that scan ble device and check distance.
If distance is reached defined value an app conect to device and comunicate with the device.
I am wondering if I can scan on background like foreground.
I have tested many times and figured out some test result.
1. There are two test app. Each app can scan on foreground and background.
2. A app is on background and another app is scaning on foreground.
3. The app on background get called "- (void)centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)peripheral advertisementData:(NSDictionary *)advertisementData RSSI:(NSNumber *)RSSI" frequently like on foreground with CBCentralManagerScanOptionAllowDuplicatesKey : @YES.
4. If I scroll up on spring board to show small setting screen, the app on background get called like 3.
I know CBCentralManagerScanOptionAllowDuplicatesKey is ignored when a app is in background. But the result is wired.
If an app scan in background like foreground, How can I do that?
Finally, I downloaded an app at app store and the app uses corelocation and corebluetooth framework. The app can scan ble on background like it is in active and comunicate with ble device all the time. Even if I terminated the app and reboot my iPhone the app can scan.