My app can connect in foreground to BLE devices. But BLE device doesn't re-connect again after disconnect device while the app is in background. I added required permission in info.plist :
<key>UIBackgroundModes</key>
<array>
<string>bluetooth-central</string>
<string>bluetooth-peripheral</string>
</array>
I created central manager object for scanning in HomeViewController :
let centralManager = CBCentralManager(delegate: self, queue: nil)
centralManager.delegate = self
let options = [CBCentralManagerScanOptionAllowDuplicatesKey : true]
centralManager.scanForPeripherals(withServices:nil, options: options)
I tried scanForPeripherals with services when app in background but it doesn't work :
let backgroundScanOptions = [CBCentralManagerScanOptionSolicitedServiceUUIDsKey : true]
centralManager.scanForPeripherals(withServices: [customServiceUUIDs], options: backgroundScanOptions)
What can I do for re-connect device in background ?