Flutter-permission-handler: Permission status not returning proper status.

Created on 30 Jun 2021  路  8Comments  路  Source: Baseflow/flutter-permission-handler

馃悰 Bug Report

Expected behavior

  • If request for permission and then cancel permission dialog by back pressed then permissionRequestStatusreceived permanentlyDenied, it should return deniedstatus instead of permanentlyDenied.
  • If permission is PermanentlyDenied, but if we check permission status by permission.status.isPermanentlyDenied then it's returning false.

Reproduction steps

  1. Request any permission
  2. Cancel permission by dialog by back press
  3. Check permission status (received permanentlyDenied)

Configuration

Version: 8.1.2

Platform:

  • [x] :iphone: iOS
  • [x] :robot: Android
needs more info

Most helpful comment

I have the similar issue here, on iOS if I ask for camera permission by await Permission.camera.status, I got PermissionStatus.denied, while in fact the permission is granted, as seen in the app setting page.

All 8 comments

I'm currently facing the same issue.

I have my location and Bluetooth permission enabled for iOS, but when I do:

final location = await Permission.location.request().isGranted;
final bluetooth = await Permission.bluetooth.request().isGranted;

I get both in false.

This is only happening on iOS for me, android is working great

Also I'm trying to request location permission. But, it's not showing dialog prompt anyway.

Also, it shows permanentlydenied status always.

It works find in android. But, issue persists in iOS devices

@fldvlpr But that is not a bug. On ios if a permission was already denied the prompt is not shown again the user has to manually go to settings to change the permission. You can read more on it here: https://stackoverflow.com/a/65920169/12933203

@elianmortega I think @fldvlpr told about other problem. When he call request some permission, he didn't see window with dialog about permission, but plugin had response 'permanentlyDenied' status. I have too this bug

I have the similar issue here, on iOS if I ask for camera permission by await Permission.camera.status, I got PermissionStatus.denied, while in fact the permission is granted, as seen in the app setting page.

I have this code for android 11 and higher version, it takes user to the app permission screen when the user selects Allow all the time option and comes back , this status throws a permanentlyDenied result.

var status = await Permission.locationAlways.request();
if(status.isGranted)
{
Fluttertoast.showToast(msg: "Permission Granted");
loadData();
}

@elianmortega I think @fldvlpr told about other problem. When he call request some permission, he didn't see window with dialog about permission, but plugin had response 'permanentlyDenied' status. I have too this bug

I downgrade the plugin to 6.0.1, it works.

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

Was this page helpful?
0 / 5 - 0 ratings