Baseflow / Baseflow/flutter-permission-handler

Can we have something other than PermanentlyDenied if _that permission_ doesn't exist on that device

Open
#836 0 comments 1 reaction 0 assignees View on GitHub
P2 type: enhancement
Dominant language
Dart
Stars
2.2k
Forks
970
Avg merge
14h 22m
Merged PRs (30d)
2

Description

## 🐛 Bug Report

When you ask for a permission that's not in _that platform_, the response is "PermanentlyDenied" instead of "Granted" or "NotSupported" (new).

Which makes things like "request BluetoothConnection _fail_ on iOS yet is required on Android and makes the app have to be platform-aware.

### Expected behavior

If unsupported permissions returned "Granted" or "NotSupported" (new), then the developer could simply say:
```
if (await Permission.locationWhenInUse.request().isPernamentlyDenied)
OpenSettings("This is a bluetooth app... please enable Bluetooth Connections");
```
blindly without checking to see which OS or version the app is running on.
As it is now, it would present the App Settings... which won't have the permission (because it doesn't exist in iOS), so either the user will be confused or you need to check the Platform and then the Readme to figure out if you need to ask for that permission on that platform... and if things change then you'll need to add more and more exceptions to the code.

### Reproduction steps

ParentBug: 830

### Configuration

**Version:** 1.x

**Platform:**
- [X] :iphone: iOS
- [X] :robot: Android

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.