Keeping BLE and GPS active in background with screen locked (React Native + Expo)

4 weeks ago 21
ARTICLE AD BOX

I’m developing a mobile app in React Native using Expo, and I’m testing it through an EAS development build (not Expo Go). The app uses Bluetooth Low Energy (BLE) to communicate with an external device and relies on continuous geolocation updates.

The issue I’m facing is that when the phone screen is locked, I’m unable to keep both BLE and GPS active at the same time. After the device goes into lock screen, the OS starts restricting the app: sometimes the BLE connection drops, sometimes location updates stop, and occasionally both are suspended.

The intended behavior requires the app to work with the screen off, so background execution is essential. I’ve already tried requesting “always” location permissions, disabling battery optimizations, and using background tasks / services, but the behavior remains unstable once the screen is locked.

I’m trying to understand what the correct approach is in this scenario. Is a foreground service mandatory to reliably keep BLE and GPS running in the background? Are there known limitations with Expo / React Native regarding this kind of use case, or recommended architectural patterns to handle it properly?

Any insights, best practices, or references to documentation would be very helpful.

Thanks in advance.

Read Entire Article