Open galunecandrey opened 4 years ago
Hello, I thought this was an issue too but I found the following, maybe it helps others too.
When you check permission status you can specify the permission level to check:
checkPermissionStatus(level: LocationPermissionLevel.locationWhenInUse)
the default is LocationPermissionLevel.location
, so if the user only granted whenInUse, the default call for permissions will be "denied".
Depending on your requirements you can check different permission levels, to display different messages. So if you see that you have permission for whenInUse but not for always, you can tell the user why you want to access the location at al times.
In my scenario I only needed whenInUse, so I just asked whenInUse permission locationPermissions.requestPermissions( permissionLevel: LocationPermissionLevel.locationWhenInUse);
and checked for whenInUse access checkPermissionStatus(level: LocationPermissionLevel.locationWhenInUse)
.
PermissionStatus permissionInUse = await LocationPermissions().checkPermissionStatus(level: LocationPermissionLevel.locationWhenInUse);
@diegogarciar that's helpful. Thanks!
Hi!
I updated to the latest version(3.0.0+1), and I have an issue with the checkPermissionStatus on Android when the user selects "Allow only while using the app". Basically, when the prompt appears in Android:
checkPermissionStatus
return "granted" (which is fine)checkPermissionStatus
return "denied", (also fine)checkPermissionStatus
return "denied" (here is the problem). ButrequestPermissions
return "granted".On IOS all good.