flutter-permission-handler icon indicating copy to clipboard operation
flutter-permission-handler copied to clipboard

v8.1.6 Permission.contacts.request() not popping up permission request screen

Open jasonkaruza opened this issue 2 years ago • 2 comments

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).

jasonkaruza avatar Jan 16 '22 01:01 jasonkaruza

This was the problem for us: https://github.com/Baseflow/flutter-permission-handler/issues/568#issuecomment-853681192

hillelcoren avatar Jan 16 '22 18:01 hillelcoren

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" />

jasonkaruza avatar Jan 30 '22 19:01 jasonkaruza

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,

TimHoogstrate avatar Aug 24 '23 08:08 TimHoogstrate

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.

github-actions[bot] avatar Sep 07 '23 09:09 github-actions[bot]