Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: requestPermission Future never resolves, when application goes to background, when "Allow to use location" popup is displayed #1518

Open
3 of 8 tasks
tobolski opened this issue May 23, 2024 · 1 comment
Assignees
Labels
P2 Important issues not at the top of the work list. type: enhancement New feature or request

Comments

@tobolski
Copy link

tobolski commented May 23, 2024

Please check the following before submitting a new issue.

Please select affected platform(s)

  • Android
  • iOS
  • Linux
  • macOS
  • Web
  • Windows

Steps to reproduce

  1. Enable location on device and in application.
  2. Execute: final permission = await Geolocator.requestPermission();
  3. "Allow to use location" popup should appear:
    image
  4. Lock the phone.
  5. Unlock the phone.

Expected results

  • Bring back "Allow to use location" when going back to application.
    OR
  • Complete the Future with proper state.

Actual results

  1. "Allow to use location" is gone.
  2. final permission = await Geolocator.requestPermission(); is waiting forever.
  3. Another call to this method results in exception:
Unhandled Exception: A request for location permissions is already running, please wait for it to complete before doing another request.

Code sample

Code sample
final permission = await Geolocator.requestPermission();

Screenshots or video

final permission = await Geolocator.requestPermission();

Version

12.0.0

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.19.6, on macOS 14.4.1 23E224 darwin-arm64, locale en-PL)
    • Flutter version 3.19.6 on channel stable at /Users/xxx/git/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 54e66469a9 (5 weeks ago), 2024-04-17 13:08:03 -0700
    • Engine revision c4cd48e186
    • Dart version 3.3.4
    • DevTools version 2.31.1
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/xxx/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)
    • All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 15.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15C500b
    • CocoaPods version 1.15.2
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.1)
[✓] VS Code (version 1.89.1)
[✓] Connected device (5 available)
[✓] Network resources
    • All expected network resources are available.

• No issues found!
@TimHoogstrate
Copy link
Contributor

Dear @tobolski,

This is a known issue in iOS. I'll label this as an enhancement there are multiple issues regarding this situation.

Kind regards

@TimHoogstrate TimHoogstrate self-assigned this Aug 20, 2024
@TimHoogstrate TimHoogstrate added type: enhancement New feature or request P2 Important issues not at the top of the work list. labels Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 Important issues not at the top of the work list. type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants