Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS for Reliable Location Tracking #127

Open
LukasGrubis opened this issue Dec 17, 2024 · 1 comment

Comments

@LukasGrubis
Copy link

Is your feature request related to a problem? Please describe.
On Android devices, battery optimization settings can interrupt or restrict background location tracking. This leads to inconsistent behavior when accurate and continuous location updates are required.

Describe the solution you'd like
We request the addition of support for the ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS intent in the Capacitor background geolocation plugin. This would enable developers to prompt users to exempt the app from battery optimizations.

Describe alternatives you've considered
There are no reliable workarounds to bypass Android’s battery optimization restrictions without user intervention.

Additional context
Adding this support will allow developers to ensure consistent and uninterrupted background location tracking on Android devices.

@diachedelic
Copy link
Collaborator

ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS is even more direct then ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS.

I have tried to avoid adding Android or iOS specific features to this plugin, but I agree that this one is pretty important. Unfortunately it depends on the <uses-permission-sdk-23 android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" /> permission, even if the app never uses this feature. Could that be an impediment to Play Store review?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants