I want to get the allow once event from permissions.
const status = await Geolocation.requestAuthorization('whenInUse');
console.log(status)
if (status === 'granted') {
return true;
}
if (status === 'denied') {
Alert.alert('Location permission denied');
}
if (status === 'disabled') {
Alert.alert(
`Turn on Location Services to allow "${appConfig.displayName}" to determine your location.`,
'',
[
{ text: 'Go to Settings', onPress: openSetting },
{ text: "Don't Use Location", onPress: () => { } },
],
);
}
here status has values denied, granted, and never ask again. How do I get the value of allow once as if i select allow once option in the device, status is granted and it is getting stored in state variable and I want to empty the variable if the user selects allow once option.
I want to get the allow once event from permissions.
const status = await Geolocation.requestAuthorization('whenInUse'); console.log(status) if (status === 'granted') { return true; }
here status has values denied, granted, and never ask again. How do I get the value of allow once as if i select allow once option in the device, status is granted and it is getting stored in state variable and I want to empty the variable if the user selects allow once option.