I'm building a function that looks for location permission to do some action when it is denied (or permanently denied on Android). When I grant it and go to the settings on Android then switch it to deny, the next time that I request the status the permission come as undetermined. Should not it be denied (or permanently denied)?
EDIT: Even if I immediately deny permission, it is also returned undetermined.
I think I have the same issue. In Android emulator I get
Permission.locationAlways.status = undetermined
when the app's setting is Allow only while using the app
@gkrawiec I'm having it even on a real device.
I'm having a similar issue on both android and iOS. Permission status returns "undetermined" without asking for permission regardless of whether permission is given or has never been asked for.
I'm also experiencing this. My experience is that this works correct on iOS and on Android it works like this:
This is a big problem for our app, have anyone found a workaround?
I am having same problem described by @mikeesouth . Works correctly on iOS.
My work around in Android is catching the exception, check the message on it and treat accordingly.
The Exception I get when user permanently deny Access do Photos:
catch (e) {
if (Platform.isAndroid && e is PlatformException) {
if (e.code == "photo_access_denied") {
await _permissionsService.requestExceptionPhotoAndroid();
}
}
Is there a workaround for this?
I'm using the workaround posted by @jeanadam. Works nicely.
interesting, but I am not getting any exceptions. Just undetermined.
Same issue here If the app has been granted permission using the android settings app, then whenever I check the status of the permission it is always undetermined. In my particular flow, I have a page that shows the user all the permissions granted or not using switches. And requesting permission on that page is not the business flow.
here is how I now figure out what the permission for location is
https://github.com/Baseflow/flutter-permission-handler/issues/349#issuecomment-662530239
Same issue here If the app has been granted permission using the android settings app, then whenever I check the status of the permission it is always undetermined. In my particular flow, I have a page that shows the user all the permissions granted or not using switches. And requesting permission on that page is not the business flow.
Hi all,
I am unable to reproduce the issue.
Could you try to use the latest version of permission handler and see if it still persist?
And if so you could you provide the output of your flutter doctor -v command?
Possibly related to #336
I see the issue as well. When the location permission is set to "Deny" for my app , the status still returns "undetermind". I am testing on Android 10. Ouput of flutter doctor -v:
[✓] Flutter (Channel stable, 1.22.6, on Mac OS X 10.15.7 19H114 darwin-x64, locale en-DK)
• Flutter version 1.22.6 at /Users/tashiwangdi/work/flutter_dev/flutter
• Framework revision 9b2d32b605 (5 days ago), 2021-01-22 14:36:39 -0800
• Engine revision 2f0af37152
• Dart version 2.10.5
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /Users/tashiwangdi/Library/Android/sdk
• Platform android-29, build-tools 29.0.2
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 12.2)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.2, Build version 12B45b
• CocoaPods version 1.10.1
[✓] Android Studio (version 4.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin installed
• Dart plugin version 201.9317
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
[!] IntelliJ IDEA Community Edition (version 2020.1)
• IntelliJ at /Applications/IntelliJ IDEA CE.app
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
• For information about installing plugins, see
https://flutter.dev/intellij-setup/#installing-the-plugins
[✓] VS Code (version 1.52.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.18.1
[✓] Connected device (2 available)
• Pixel XL (mobile) • HT77F0201745 • android-arm64 • Android 10 (API 29)
• iPhone 12 Pro Max (mobile) • FB2918DA-1B52-48EE-82F3-BE51BC261673 • ios • com.apple.CoreSimulator.SimRuntime.iOS-14-2 (simulator)
I am having this issue with android only for the storage permission.
In verbose mode it prints out:
D/permissions_handler(28401): No permissions found in manifest for: 15
but I have the permissions in the manifest.
I can't make any sense of this and the location permissions work nicely.
My flutter doctor -v:
[✓] Flutter (Channel stable, 1.22.6, on macOS 11.1 20C69 darwin-x64, locale en-GB)
• Flutter version 1.22.6 at /Users/hydrologis/SOFTWARE/flutter
• Framework revision 9b2d32b605 (13 days ago), 2021-01-22 14:36:39 -0800
• Engine revision 2f0af37152
• Dart version 2.10.5
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /Users/hydrologis/Library/Android/sdk
• Platform android-30, build-tools 30.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 12.4)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.4, Build version 12D4e
• CocoaPods version 1.10.1
[✓] VS Code (version 1.52.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.19.0
I am having this issue with android only for the storage permission.
The same issue, android api 30, updating to 5.1.0+2 is fixing it
Hi @brenoasm, do you still face this issue?
Updating to the newest version of the permission-handler plugin might solve the problem.
Can anyone let me know if this issue is solved by using the newest version of the plugin, so the issue can be closed?
Thanks in advance!
@JDDV hi! I cannot test It for now. If you think its solved, then close It. Thanks!
I tried to reproduce it with the newest version, but I wasn't able to get the same problem.
The issue will be closed, if anyone still has this problem please let us know!
Most helpful comment
I am having same problem described by @mikeesouth . Works correctly on iOS.
My work around in Android is catching the exception, check the message on it and treat accordingly.
The Exception I get when user permanently deny Access do Photos: