When app goes to background I wanted to connect bluetooth device with Core Bluetooth, With BGProcessingTask
I was able to perform background task(it executes after 15 min keeping app in background) but connection is not happening it didn't trigger CBCentralManagerDelegate
methods.
Here is what I've tried.
- I have enabled necessary Background Modes in Capabilities.
- Added required things in info.plist.
- When app launches I'm registering BGProcessingTask as below.
- When app goes to background will submit request and after 15 min it starts executing task handleBackgroundSync function.
- In the handleBackgroundSync function as usual I'm trying to connect bluetooth device with Core Bluetooth. With breakpoint can debug upto scanning but CBCentralManagerDelegate delegates methods are not triggering and when I come to foreground then it triggers.
Is there a way to establish bluetooth connection with the BGProcessingTask can someone please suggest ?