Hi all,
We’re running into a challenge with our iOS app DriveSmarter, which uses background location updates when connected to a physical Bluetooth device (e.g., dash cam, radar detector). For battery efficiency, we disable location services in the background when no device is connected. The problem we’re now facing is:
How can we programmatically re-enable location services when a Bluetooth device reconnects while the app is still in the background?
From what I understand, Core Location doesn’t allow re-enabling background location updates unless the app returns to the foreground. But our core use case requires this to happen seamlessly in the background when the user starts driving and the device connects again.
To clarify:
We stop location updates when the device disconnects.
We want to resume location updates only when the device reconnects, even if the app is still in the background.
Manually bringing the app to the foreground is not a reliable or user-friendly option.
So my questions:
Is it possible to programmatically restart background location services upon a Bluetooth connection event while staying in the background?
If not, are there any best practices or Apple-recommended alternatives to achieve a similar result?
Any guidance, patterns, or creative solutions would be greatly appreciated!
Thanks in advance