Using Core Bluetooth to receive Bluetooth LE peripheral ads in the background

I'm having trouble figuring out how to receive Bluetooth LE peripheral ads while my app is running in the background. That is, when my application is in the background, it never reaches the didDiscoverPeripheral () method - where the ad lies. Does anyone know how I need to configure my application so that I can receive Bluetooth LE advertisements while my application is in the background? Can this be done with polling threads when my application is in the background? Note. I want to receive advertisements from all BLE devices, and not with a certain number of BLE devices.

Rate the help

Casey

+6
source share
1 answer

I am doing this from my application.

in the background, CoreBluetooth is said to be up to 55 times slower than the peripheral ad interval. To speed this up, I programmed an ad peripheral every 20 ms for the first 30 seconds.

You should also define “Background mode required” when “Application communicates using CoreBluetooth” in your project “Goals” → “Information”.

The application takes some time to search for peripherals in the background.

+7
source

All Articles