Baseflow / Baseflow/flutter-permission-handler

[Regression]: iOS now requires to obtain "When in use" location permission before requesting "Always" location permission

Open
#1,324 1 comment 2 reactions 1 assignee Claimed by @TimHoogstrate View on GitHub
P2 type: documentation type: enhancement
Dominant language
Dart
Stars
2.2k
Forks
970
Avg merge
14h 22m
Merged PRs (30d)
2

Description

### Is there an existing issue for this?

- [X] I have searched the [existing issues](https://github.com/baseflow/flutter-permission-handler/issues).

### Please select affected platform(s)

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

### Old behavior

Old versions of the plugin worked as intended.

### Current behavior

iOS now requests to obtain "When in use" location permission before requesting "Always" location permission

PlatformException: `MISSING_WHENINUSE_PERMISSION, Must have "When in use" permission before it is allowed to request "Always" permission`

iOS version: 17.4.1
phone: iPhone 13 Pro Max
flutter doctor's output:
```
[✓] Flutter (Channel stable, 3.19.6, on macOS 13.6.3 22G436 darwin-x64, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.3)
[✓] VS Code (version 1.88.1)
[✓] Connected device (3 available)
! Error: Browsing on the local area network for ES6. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
The device must be opted into Developer Mode to connect wirelessly. (code -27)
! Error: Browsing on the local area network for Luka’s iPhone. Ensure the device is unlocked and attached with a cable or associated with the same local area network as
this Mac.
The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources

• No issues found!
```

### Steps to reproduce

1. call `Permission.locationAlways.request()` before obtaining the "When in use" location permission

### Code sample

Code sample

```dart
if (Platform.isIOS) {
await Permission.locationAlways.request();
}
```

### Screenshots or video

Screenshots or video demonstration

![Screenshot 2024-05-24 at 10 31 26](https://github.com/Baseflow/flutter-permission-handler/assets/24469472/3ea5d6f0-731f-4fd2-af85-7bfb29abef03)

### Current version

11.3.1

### Last version without regression

11.3.0

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.