Baseflow / Baseflow/flutter-permission-handler

[Bug]: Permission.always.status returns permanentlyDenied even when can be requested

Open
#1,145 11 comments 8 reactions 0 assignees View on GitHub
P2 platform: ios type: bug
Dominant language
Dart
Stars
2.2k
Forks
970
Avg merge
14h 22m
Merged PRs (30d)
2

Description

### Please check the following before submitting a new issue.

- [X] I have searched the [existing issues](https://github.com/baseflow/flutter-permission-handler/issues).
- [X] I have carefully [read the documentation](https://github.com/Baseflow/flutter-permission-handler/blob/main/permission_handler/README.md) and verified I have added the required platform specific configuration.

### Please select affected platform(s)

- [ ] Android
- [X] iOS
- [ ] Windows

### Steps to reproduce

1. request locationWhileInUse
2. Choose 'Allow While Using App' on the ios device
3. get status from location always permission

I already mentioned this issue here https://github.com/Baseflow/flutter-permission-handler/issues/1128. But since it's closed I decided to open another one. Maybe I am missing something again

### Expected results

the permission status of the always location should be denied since it never was requested but can be requested

### Actual results

the permission status is permantelyDenied. And therefore I have no way to check if I can request always permission or not

### Code sample

Code sample

```dart
final locationWhenInUseStatus = await Permission.locationWhenInUse.request();
if (locationWhenInUseStatus.isPermantlyDenied) {
print("Can't request always permission");
} else {
var locationAlwaysStatus = await Permission.locationAlways.request();
// is never reached since 'Allow Only Once' and 'Allow While Using App' both return permantlyDenied
}
```

### Screenshots or video

_No response_

### Version

10.2.0

### Flutter Doctor output

Doctor output

```console
[✓] Flutter (Channel stable, 3.7.12, on macOS 13.3.1 22E772610a darwin-arm64, locale en-DE)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.2)
[✓] IntelliJ IDEA Ultimate Edition (version 2020.3.2)
[✓] VS Code (version 1.81.1)
[✓] Connected device (4 available)
[✓] HTTP Host Availability

• No issues found!
```

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.