flutter-permission-handler
flutter-permission-handler copied to clipboard
v8.1.6 Permission.contacts.request() not popping up permission request screen
Flutter Doctor
[√] Flutter (Channel stable, 2.2.2, on Microsoft Windows [Version 10.0.19043.1415], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[√] Chrome - develop for the web
[√] Android Studio (version 4.1.0)
[√] VS Code (version 1.63.2)
[√] Connected device (3 available)
Package version
permission_handler: ^8.1.6
Sample Code
status = await Permission.locationWhenInUse.request(); // Shows permission request dialog
status = await Permission.sms.request(); // Shows permission request dialog
status = await Permission.contacts.request(); // DOES NOT show permission request dialog
Problem
When calling await Permission.contacts.request()
the app does not pause to show the permission request dialog for accessing contacts. It moves on to the next line of code with no error thrown. This doesn't occur for location or sms requests (both of those pause the app to display the permission request dialog).
This was the problem for us: https://github.com/Baseflow/flutter-permission-handler/issues/568#issuecomment-853681192
Thank you @hillelcoren . Unfortunately, I am compiling for Android only (for now), so the podfile isn't the issue. I have the following in my manifest file, which seems like the right configuration:
<!-- Allows reading of contacts on phone to send invites -->
<uses-permission android:name="android.permission.READ_CONTACTS" />
Dear @jasonkaruza,
This seems to work fine in the example app. If you want to request multiple permissions please try to use:
// You can request multiple permissions at once.
Map<Permission, PermissionStatus> statuses = await [
Permission.location,
Permission.storage,
].request();
print(statuses[Permission.location]);
If you still experience this issue please let us know.
Kind regards,
Without additional information, we are unfortunately not able to resolve this issue. Therefore, we reluctantly closed this issue for now. If you run into this issue later, feel free to file a new issue with a reference to this issue. Add a description of detailed steps to reproduce, expected and current behaviour, logs and the output of 'flutter doctor -v'. Thanks for your contribution.