Baseflow / Baseflow/flutter-geolocator

[Bug]: The error is that the permission popup reappears when the screen is turned off on iOS.

Open
#1,478 2 comments 0 reactions 1 assignee Claimed by @TimHoogstrate View on GitHub
P2 type: bug
Dominant language
Dart
Stars
1.3k
Forks
803
Avg merge
8h 16m
Merged PRs (30d)
1

Description

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

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

### Please select affected platform(s)

- [ ] Android
- [X] iOS
- [ ] Linux
- [ ] macOS
- [ ] Web
- [ ] Windows

### Steps to reproduce

1. Open the application and request location permission.
2. When the location permission popup appears, turn off the screen (without selecting any option on the popup).
3. Press the home button to reopen. At this point, the operating system has closed the location permission popup. When calling the location permission request command again, the library returns an error "A request for location permissions is already running, please wait for it to complete before doing another request.".

### Expected results

You can recall the permission request in this case

### Actual results

Unable to recall the permission request in case the operating system closes the previous permission popup.

### Code sample

Code sample

```dart
await Geolocator.requestPermission();
```

### Screenshots or video

Screenshots or video demonstration

![Screenshot 2024-04-11 at 17 45 17](https://github.com/Baseflow/flutter-geolocator/assets/56058662/45f0ccdc-6e4c-4e79-887a-4dabfd7a764c)

### Version

10.4.2

### Flutter Doctor output

Doctor output

```console
[!] Flutter (Channel stable, 3.13.9, on macOS 14.2 23C64 darwin-x64, locale en-US)
• Flutter version 3.13.9 on channel stable at /Users/bravesoft/Desktop/flutter/sdk/flutter
! Warning: `dart` on your path resolves to /usr/local/Cellar/dart/2.17.6/libexec/bin/dart, which is not inside your current Flutter SDK checkout at /Users/bravesoft/Desktop/flutter/sdk/flutter. Consider adding /Users/bravesoft/Desktop/flutter/sdk/flutter/bin to the front of your path.
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision d211f42860 (6 months ago), 2023-10-25 13:42:25 -0700
• Engine revision 0545f8705d
• Dart version 3.1.5
• DevTools version 2.25.0
• If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at /Users/bravesoft/Library/Android/sdk/
✗ cmdline-tools component is missing
Run `path/to/sdkmanager --install "cmdline-tools;latest"`
See https://developer.android.com/studio/command-line for more details.
✗ Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.

[✓] Xcode - develop for iOS and macOS (Xcode 15.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 15C65
• CocoaPods version 1.15.2

[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)

[✓] VS Code (version 1.68.1)
• VS Code at /Users/bravesoft/Downloads/Visual Studio Code.app/Contents
• Flutter extension can be installed from:
🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (3 available)
• iPhone SE (3rd generation) (mobile) • 18CB3D56-33C9-4D4B-BD9C-629CC408E484 • ios • com.apple.CoreSimulator.SimRuntime.iOS-17-2 (simulator)
• macOS (desktop) • macos • darwin-x64 • macOS 14.2 23C64 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 123.0.6312.107
! Error: Browsing on the local area network for iPhoneKhanhTon. 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
• All expected network resources are available.
```

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.