Reputation: 21
I need to track riders and there for need to track their location in the background. There is an issue with a pop up message for allowing location: there are only 3 options
I'd like to have "Always allow" option in this pop up
How can I do it for Android?
Upvotes: 1
Views: 5171
Reputation: 1569
On Android 10 (API level 29) and higher, you must declare the ACCESS_BACKGROUND_LOCATION permission in your app's manifest in order to request background location access at runtime. On earlier versions of Android, when your app receives foreground location access, it automatically receives background location access as well.
When a feature in your app requests background location on a device that runs Android 10 (API level 29), the system permissions dialog includes an option named Allow all the time. If the user selects this option, the feature in your app gains background location access.
On Android 11 (API level 30) and higher, however, the system dialog doesn't include the Allow all the time option. Instead, users must enable background location on a settings page.
font: https://developer.android.com/training/location/permissions
Upvotes: 4