Baseflow / Baseflow/flutter-permission-handler

[PermissionRequestInProgressException] LocationAlways throws ERROR_ALREADY_REQUESTING_PERMISSIONS

Open
#783 15 comments 2 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

## 🔙 Regression

### Old (and correct) behavior
Permission.locationAlways.request() was working.

### Current behavior
Permission.locationAlways.request() throws an error:
```
Unhandled Exception: PlatformException(ERROR_ALREADY_REQUESTING_PERMISSIONS, A request for permissions is already running, please wait for it to finish before doing another request (note that you can request multiple permissions at the same time)., null, null)
#0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:607:7)
#1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:177:18)

#2 MethodChannelPermissionHandler.requestPermissions (package:permission_handler_platform_interface/src/method_channel/method_channel_permission_handler.dart:71:9)

#3 PermissionActions.request (package:permission_handler/permission_handler.dart:44:31)

#4 FuturePermissionStatusGetters.isGranted (package:permission_handler_platform_interface/src/permission_status.dart:90:40)

#5 _MapBoxScreenState.startGeofences (package:aschaffenburger_geschichten/screens/discover/map_box.dart:434:8)

```
### Reproduction steps
```
Future getPermission() async {
if(await Permission.locationWhenInUse.request().isGranted){
await Permission.locationAlways.request();
}
}
```

### Configuration

**Version:** 8.3

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

**flutter doctor:**
```
[✓] Flutter (Channel stable, 2.10.0, on macOS 12.1 21C52 darwin-arm, locale de-DE)
[✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
[✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Android Studio (version 2020.3)
[✓] VS Code (version 1.63.2)
[✓] Connected device (1 available)
[✓] HTTP Host Availability
```

The plugin is setup according to the instructions. I added `"PERMISSION_LOCATION=1"` to my `Podfile` and have all necessary keys and strings in my `Info.plist`.

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.