react-native-geolocation
react-native-geolocation copied to clipboard
Permission request pop-up coming twice if i deny permission
Ask your Question
When the app requests location permissions on Android, the permission popup appears twice. It seems that the PermissionsAndroid.request function is being triggered multiple times under certain conditions, leading to duplicate permission dialogs. why ?
const granted = await PermissionsAndroid.request( PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION, );
if (granted === PermissionsAndroid.RESULTS.GRANTED) {
console.log('Location permission granted');
return true;
} else if (granted === PermissionsAndroid.RESULTS.DENIED) {
console.log('Location permission denied');
return false;
}
I also faced some issue but after using the react-native-permission library it is working fine as the inbuilt PermissionsAndroid of react native does not works ok all the time. I will recommend you to use below library for all the permission handling in react native. https://www.npmjs.com/package/react-native-permissions
I also faced some issue but after using the react-native-permission library it is working fine as the inbuilt PermissionsAndroid of react native does not works ok all the time. I will recommend you to use below library for all the permission handling in react native. https://www.npmjs.com/package/react-native-permissions
Even using the react-native-permission yielding the same double pop up issue for me