Flutter-permission-handler: [BUG][iOS/Android]Once deny permission, never open permission dialog

Created on 5 Sep 2020  路  5Comments  路  Source: Baseflow/flutter-permission-handler

馃悰 Bug Report


once deny for permission dialog, never open dialog

Expected behavior

open dialog again

Reproduction steps

other plugin

      final _picker = ImagePicker();
      final packedFile = await _picker.getImage(source: imageSource);

I denyed.

And I wrote
Permission.camera.request()
never heppend

Configuration

Version: 1.x

Platform:

  • [ o ] :iphone: iOS
  • [ o] :robot: Android
question

All 5 comments

I also have similar issues before, but it is due to the incorrect Permission type in different platform.


Permission permission;

//check platform, different platform using different permission
if (Platform.isAndroid) {
  permission = Permission.storage;
} else if (Platform.isIOS) {
  permission = Permission.photos;
}

await permission.request().isGranted;

if (await permission.status == PermissionStatus.granted) {
    //your function required permission 
}else{
    //alert user about permission is not granted
}

@Baseflow
is it a bug? or Android/iOS common behavior?

Is it iOS specification?

https://stackoverrun.com/ja/q/3773839

If the user checks the Never ask again box and taps Deny, the system no longer prompts the user if you later attempt to requests the same permission.

https://developer.android.com/guide/topics/permissions/overview

If the user denies permission permanently it is not possible to show the dialog again. To fix this, make the user go to settings and grant permission.

The documentation states the following:

You can also open the app settings:

if (await Permission.speech.isPermanentlyDenied) {
  // The user opted to never again see the permission request dialog for this
  // app. The only way to change the permission's status now is to let the
  // user manually enable it in the system settings.
  openAppSettings();
}

Was this page helpful?
0 / 5 - 0 ratings