Baseflow / Baseflow/flutter-permission-handler

[Bug]:Lock the screen when the address permission is enabled,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)

Open
#1,261 13 comments 16 reactions 1 assignee Claimed by @mvanbeusekom View on GitHub
P2 platform: ios refactor 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 address permission
2、Lock screen
3、Request address permission

### Expected results

The address permission dialog box is displayed

### Actual results

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)

### Code sample

Code sample

```dart
static openStore(
BuildContext context,
) async {
Permission.location.status.then((value) {
if (value == PermissionStatus.granted) {
openStorePage(context, 0);
} else if (value == PermissionStatus.denied) {
Permission.location.request().then((value) {
if (value == PermissionStatus.granted) {
openStorePage(context, 0);
} else {
openStorePage(context, 2);
}
});
AndroidUtil.clearFlagSecure();
} else if (value == PermissionStatus.permanentlyDenied || value == PermissionStatus.restricted) {
openStorePage(context, 1);
} else {
if (Platform.isAndroid) {
Permission.location.request().then((value) {
if (value == PermissionStatus.granted) {
openStorePage(context, 0);
} else {
openStorePage(context, 1);
}
});
AndroidUtil.clearFlagSecure();
}
}
});
}
```

### Screenshots or video

Screenshots or video demonstration

[Upload media here]

### Version

11.0.1

### Flutter Doctor output

Doctor output

```console
[✓] Flutter (Channel stable, 3.10.6, on macOS 14.0 23A344 darwin-x64, locale zh-Hans-CN)
• Flutter version 3.10.6 on channel stable at /Applications/flutter3.10.6
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision f468f3366c (6 months ago), 2023-07-12 15:19:05 -0700
• Engine revision cdbeda788a
• Dart version 3.0.6
• DevTools version 2.23.1
• Pub download mirror https://pub.flutter-io.cn
• Flutter download mirror https://storage.flutter-io.cn

```

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.