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]: The checkPermission method always returns denied on Firefox. #1657

Open
3 of 8 tasks
alihoseiny opened this issue Mar 14, 2025 · 3 comments
Open
3 of 8 tasks
Assignees

Comments

@alihoseiny
Copy link

Please check the following before submitting a new issue.

Please select affected platform(s)

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

Steps to reproduce

  1. Call the Geolocator.requestPermission() on firefox.
  2. Grant location permission.
  3. Call the Geolocator.checkPermission();

Expected results

After granting the location permission in the browser, we expect to receive proper status from the checkPermission.

Actual results

The checkPermission method always returns denied on Firefox. No matter what permission you've granted. This behavior is only visible on Firefox. The method works fine on Chrome, Edge, and Safari.
I've tested this behavior only on Windows 11.

Code sample

Code sample
LocationPermission permission = await Geolocator.checkPermission();
if (permission == LocationPermission.denied) {
     log("you don't have access to the location service");
}

Screenshots or video

Screenshots or video demonstration

[Upload media here]

Version

13.0.2

Flutter Doctor output

Doctor output
[√] Flutter (Channel stable, 3.29.2, on Microsoft Windows [Version 10.0.26100.3323], locale en-US) [992ms]
    • Flutter version 3.29.2 on channel stable at C:\Users\***\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision c236373904 (14 hours ago), 2025-03-13 16:17:06 -0400
    • Engine revision 18b71d647a
    • Dart version 3.7.2
    • DevTools version 2.42.3

[√] Windows Version (11 Pro 64-bit, 24H2, 2009) [4.3s]

[√] Android toolchain - develop for Android devices (Android SDK version 35.0.0) [7.9s]
    • Android SDK at C:\Users\***\AppData\Local\Android\sdk
    • Platform android-35, build-tools 35.0.0
    • Java binary at: C:\Program Files\Common Files\Oracle\Java\javapath\java.exe
      This JDK was found in the system PATH.
      To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version Java(TM) SE Runtime Environment (build 23.0.1+11-39)
    • All Android licenses accepted.

[√] Chrome - develop for the web [384ms]
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Build Tools 2019 16.11.8) [382ms]
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools
    • Visual Studio Build Tools 2019 version 16.11.32002.261
    • Windows 10 SDK version 10.0.19041.0

[!] Android Studio (not installed) [203ms]
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/to/windows-android-setup for detailed instructions).

[√] IntelliJ IDEA Ultimate Edition (version 2024.3) [202ms]
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA 2024.1.4
    • Flutter plugin version 83.0.4
    • Dart plugin version 243.23654.44

[√] VS Code (version 1.95.3) [37ms]
    • VS Code at C:\Users\***\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.100.0

[√] Connected device (3 available) [394ms]
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.26100.3323]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 134.0.6998.89
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 133.0.3065.92

[√] Network resources [1,402ms]
    • All expected network resources are available.
@ajbarry
Copy link

ajbarry commented Mar 15, 2025

I am getting the same thing on Chrome on MacOS. The exception thrown is:

TypeError: Failed to execute 'query' on 'Permissions':
  Failed to read the 'name' property from 'PermissionDescriptor':
    Required member is undefined.

@TimHoogstrate
Copy link
Contributor

Dear @alihoseiny,

If the geolocator is unable to get a permissionStatus on web it returns denied. I don't have a Windows machine currently, but this should work properly on Firefox. Are you sure you have not a restricted location permission?

Kind regards,

@TimHoogstrate TimHoogstrate self-assigned this Apr 8, 2025
@TimHoogstrate TimHoogstrate added the status: needs more info We need more information before we can continue work on this issue. label Apr 8, 2025
@alihoseiny
Copy link
Author

Yes. I'm sure about the correctness of the permission granting process. The browser itself says that it allowed location access to the program.

Image

@github-actions github-actions bot removed the status: needs more info We need more information before we can continue work on this issue. label Apr 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants