Does BLE Peripheral work in background on iOS?

Hello,

I am working on a Flutter application where I need to use Bluetooth Low Energy (BLE) in Peripheral mode to advertise data even when the app is in the background (or when the screen is turned off) on iOS devices.

I am using the package flutter_ble_peripheral to handle BLE advertising and peripherals. My goal is to make sure that the BLE advertising continues running when the app is minimized or in the background.

Here is what I have already done:

Added the required Bluetooth permissions in Info.plist. Enabled Background Modes in Xcode (with Bluetooth LE Accessories enabled). Used the FlutterBlePeripheral.start() method to start advertising. However, when I minimize the app or turn off the screen, the BLE advertising seems to stop. I have ensured that the app is not terminated but still the advertising is not persistent.

I would like to confirm whether flutter_ble_peripheral works reliably in the background on iOS, or if there are any additional configurations or limitations I need to consider to ensure that advertising continues in the background.

Any insights or experiences would be greatly appreciated.

Thanks!

In iOS, when an app is no longer in the foreground, the advertising changes. As explained in the documentation as well, when an app is in the background, the advertising for it is done on a "best effort" basis, and its advertisements are contained in an overflow area. This overflow data can only be accessed by another iOS device.

If you are scanning by a non-apple device, you would not be able to decode this hashed information - the details are undocumented. If you are scanning by another app running on iOS, then you can access the CBAdvertisementDataOverflowServiceUUIDsKey in the returned advertising data dictionary.

Also, when scanning by another iOS app, you must be scanning specifically for the service UUID that is being advertised by the backgrounded app. Due to the additional restrictions the scanning app may have if it is scanning in the background, it may not be possible for the scanning app to be able to discover the advertising app if both are in the background.


Argun Tekant /  DTS Engineer / Core Technologies

Does BLE Peripheral work in background on iOS?
 
 
Q