Request for Guidance on Implementing BLE Scanning Across Foreground/Background/Locked States

I would like to share my specific use case and seek your guidance on implementing it effectively within iOS:

We are developing an iOS application that may run simultaneously on multiple devices near each other. The core functionality involves continuous Bluetooth Low Energy (BLE) scanning to detect peripherals (beacons) in the range of a central device. The scanning needs to function seamlessly across the following states:

•	Foreground

•	Background

•	Locked mode (when the device is locked)

Here are the detailed requirements:

1.	Scanning Behavior:

•	The central device should continuously scan for nearby BLE peripherals (beacons).

•	If a new peripheral comes into range, the application should capture its data, including:

•	Device Name

•	MAC Address

•	Payload Data

•	RSSI (Signal Strength)

2.	Peripheral Out-of-Range Handling:

•	If a detected peripheral (beacon) moves out of range, it should automatically be removed from the populated list displayed on the app.

3.	Peripheral Reappearance:

•	If a peripheral (beacon) that moved out of range comes back into range, the application should detect it again and repopulate the list with updated data seamlessly.

4.	Application State:

•	This behavior (scanning, detection, and updating) should work regardless of the app’s state:

•	Foreground

•	Background

•	Device Locked

FYI, we are using Custom Ruuvi beacons

Given the above requirements, I would greatly appreciate any guidance, suggestions, or best practices to implement this use case efficiently while adhering to iOS background execution and Bluetooth limitations.

Request for Guidance on Implementing BLE Scanning Across Foreground/Background/Locked States
 
 
Q