BLE iOS in background (app collapsed)

Hello.

In my app, I need to implement the following mechanism: I need to collect data from nearby Bluetooth devices, process them, and send this information to the server at short intervals, including when the app is minimized. Is this possible on iOS?

BGProcessingTask has restrictions related to battery saving policies and does not guarantee task execution at specific intervals. Additionally, there is a limitation on background task execution, which can occur no more frequently than every 15 minutes.

However, some apps, such as Google Maps, work in the background and update geolocation data. Could you suggest a solution for this task?

Thanks for any help on this topic

To do this, you will need to give the task of sending the data to the nearby Bluetooth devices.

If you are constantly connected to these devices, they can send a notification (using a notifying characteristic) that will wake up your app for a few seconds to read the data and process it as necessary.

If you are not constantly connected, then your app can send a connection request, and when the time comes, the Bluetooth devices can wake up and send advertising packets, to which the system will respond by waking your app, and you can complete the connection and read the data as necessary.

If you are not familiar with how Bluetooth and CoreBluetooth works, you may want to familiarize yourself with that, as explaining the mechanisms of how all this works is beyond the scope of a forum post.

At least on the iOS side you can start by reading this: https://developer.apple.com/library/archive/documentation/NetworkingInternetWeb/Conceptual/CoreBluetooth_concepts/CoreBluetoothBackgroundProcessingForIOSApps/PerformingTasksWhileYourAppIsInTheBackground.html


Argun Tekant /  DTS Engineer / Core Technologies

Hello and thanks for the feedback. Maybe I was not precise enough with my question. When in background mode, I only need to wake up and scan for BLE devices advertisement around the phone. No need for any connexion or so. Is this scenario feasible on iOS? Thanks for any hint to make this possible.

BLE iOS in background (app collapsed)
 
 
Q