I used IONIC Capacitor/Geoloction module. I want to check and request location permissions.
At first, I added three keys on Info.plst file in XCode Project.
NSLocationAlwaysUsageDescription
description here.
NSLocationAlwaysAndWhenInUseUsageDescription
description here.
NSLocationWhenInUseUsageDescription
description here.
I used this code to check and request permission.
let isLocationAvailable:any
const hasPermissin = await Geolocation.checkPermissions();
if (hasPermissin.location == 'granted'){
isLocationAvailable = true
}
else{
let permissionStatus = await Geolocation.requestPermissions()
isLocationAvailable = permissionStatus.location === 'granted' ? true: false
}
But it displayed only Allow Once, While Using App, Don’t Allow options.
There is no Always On option, How can I fix this problem?