cordova-plugin-android-permissions
cordova-plugin-android-permissions copied to clipboard
Background Location permission issue
when i request for the location permission it doesn’t show allow all the time in the popup. i have already added ACCESS_BACKGROUND_LOCATION in the manifest.
On which version of Android are you testing? You have to get this permission from app settings since Android 11.
See the docs
Do you have any idea to open the permission settings instead of app settings using this plugin??
Try this:
permissions.requestPermission(permissions.ACCESS_BACKGROUND_LOCATION, success, error);
function error() {
console.warn('ACCESS_BACKGROUND_LOCATION permission is not turned on');
}
function success( status ) {
if( !status.hasPermission ) error();
}
@zdevaty Why when i run the code you quoted it just returns ACCESS_BACKGROUND_LOCATION permission is not turned on? It does this to every single one of my request for permissions...
Maybe this permission is rejected permanently in Android settings somehow?
I don't know and I can't help you, as I changed my career so I won't have to deal with Android background location problems ever again.