Closed mlemos closed 4 years ago
Other questions?
a) how to know if the user granted permission for ALWAYS or ONLY WHEN IN USE.
b) what is the difference, in the example, of the results from LocationPermissions().checkPermissionStatus()
and the await LocationPermissions() .requestPermissions(permissionLevel: permissionLevel)
. It seems that the results are inconsistent between these two calls. As they should have the same results (after the user has permanently granted or not the permissions).
@mlemos thank you very much for thanking the time and write this great and detailed bug report. It is really appreciated.
I have just released a hotfix (version 3.0.0+1) which (thanks to @filipproch) includes a fix for this issue. It also includes a fix for iOS which showed similar behavior (requesting "when-in-use" permissions also resulted in the plugin falsely reporting "always" permission were granted).
Regarding you other questions:
a) With this hotfix the plugin will now take the supplied PermissionLevel
into consideration. So if you want to only request "when-in-use" permissions, you can call await LoctionPermissions().requestPermissions(permissionLevel: PermissionLevel.locationWhenInUse)
.
b) The checkPermissionStatus
method is meant to only check if permissions are currently granted. The requestPermissions
method is meant to really ask the user for permissions (if not yet permanently denied or granted).
Hope this helps. I will close the issue for now but please feel free to let me know if you have questions or if the problem still remains.
Hi @mvanbeusekom
I followed all steps above, updated to the latest version, and I still 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:
On IOS all good.
🐛 Bug Report
This bug has two wrong behaviors:
First: When checking for location permission status using the permission level parameter, the results are always the same independently of the permission level passed as parameter.
Second: If your project requires permission for always, the systems return denied for all permission levels if you have not granted the always permission. It doesn't differentiate the WhenInUse for the WhenInUse level.
It seems that it is missing the capability to return the propper permission status when "While In Use" is granted. Even if the query (check) is using the
LocationPermissionLevel.locationWhenInUse
is used in the method call.Expected behavior
I understand that the correct behavior would be to return the proper permission granted for permission level checked.
Reproduction steps
You can use the sample application to reproduce the error. I'm running the tests in a Nexus 4 API 29 emulator.
Check the sequences below to reproduce the error:
Configuration
My
AndroidManifest.xml
has the following lines:My
build.gradle
is set for:Version: 2.0.5
Platform: