Baseflow / Baseflow/flutter-geolocator

[PermissionRequestInProgressException] Handling PermissionRequestInProgressException on iOS

Open
#581 16 comments 4 reactions 0 assignees View on GitHub
P2 platform: ios type: bug
Dominant language
Dart
Stars
1.3k
Forks
803
Avg merge
8h 16m
Merged PRs (30d)
1

Description

## 🐛 Bug Report
On iOS, when the app goes to background while the permission dialog is showing (due to pressing power button or display timeout, usually for 30+ seconds or so) and the phone is activated again, the permission dialog is gone. Afterwards it is not possible to request a permission again because it will always throw `PermissionRequestInProgressException`.

### Expected behavior
The plugin should detect this case and ensure that the permission can be requested again.
Somehow the `confirmationHandler` needs to be cleaned up here: https://github.com/Baseflow/flutter-geolocator/blob/master/geolocator/ios/Classes/Handlers/PermissionHandler.m#L37

### Reproduction steps
1. Make a call that requests the permission so that the dialog is showing (`Geolocator.getCurrentPosition()`)
2. Press the power button and let it sleep for 30+ seconds so that the app goes fully to background
3. Wake the phone again, the dialog should be gone
4. Repeat 1.

**Version:** 6.1.4

**Platform:**
- [x] :iphone: iOS
- [ ] :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.