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]: Geolocator.requestPermission() returns not actual status in Android 30 and above #1388

Open
3 of 8 tasks
nzackoya opened this issue Dec 2, 2023 · 3 comments
Open
3 of 8 tasks
Labels
P2 Important issues not at the top of the work list. platform: android Issue is related to the Android platform. type: bug Something isn't working

Comments

@nzackoya
Copy link

nzackoya commented Dec 2, 2023

Please check the following before submitting a new issue.

Please select affected platform(s)

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

Steps to reproduce

  1. Geolocator.requestPermission(), select Allow only while using the app
  2. Go to app's permission settings and change to Allow all the time.
  3. Geolocator.requestPermission() again.

Expected results

Geolocator.requestPermission() should return actual status after manually changing the permission in settings, or in any other context.

Actual results

Geolocator.requestPermission() returns not actual status after manually changing the permission in settings.

Code sample

Code sample
await Geolocator.requestPermission();// select Allow while in use
await BackgroundLocation.startLocationService(distanceFilter: 10); // asks to change to Allow all the time.
final status = await Geolocator.requestPermission(); // in here it is while in use status

Screenshots or video

Screenshots or video demonstration

[Upload media here]

Version

10.1.0

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.16.2, on macOS 13.5.1 22G90 darwin-x64, locale en-GB)
    • Flutter version 3.16.2 on channel stable at /Library/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 9e1c857886 (30 hours ago), 2023-11-30 11:51:18 -0600
    • Engine revision cf7a9d0800
    • Dart version 3.2.2
    • DevTools version 2.28.3

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/nzakoyan/Library/Android/sdk
    • Platform android-33, build-tools 30.0.3
    • ANDROID_HOME = /Users/nzakoyan/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
    • All Android licenses accepted.

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

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

[✓] Android Studio (version 2022.3)
    • 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 17.0.6+0-17.0.6b829.9-10027231)

[✓] IntelliJ IDEA Community Edition (version 2022.3.2)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • 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

[✓] Connected device (4 available)
    • Redmi S2 (mobile)            • 1493d35       • android-arm    • Android 9 (API 28)
    • sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64    • Android 12 (API 31) (emulator)
    • macOS (desktop)              • macos         • darwin-x64     • macOS 13.5.1 22G90 darwin-x64
    • Chrome (web)                 • chrome        • web-javascript • Google Chrome 119.0.6045.199

[✓] Network resources
    • All expected network resources are available.

• No issues found!
@TimHoogstrate TimHoogstrate self-assigned this Dec 4, 2023
@TimHoogstrate
Copy link
Contributor

Dear @nzackoya,

I was not able to reproduce this issue? Can you try to reproduce this in the example app and see what happens. I am testing on a Nexus 7 real device.

Kind regards,

@TimHoogstrate TimHoogstrate added status: needs more info We need more information before we can continue work on this issue. platform: android Issue is related to the Android platform. labels Dec 4, 2023
@github-actions github-actions bot removed the status: needs more info We need more information before we can continue work on this issue. label Dec 4, 2023
@nzackoya
Copy link
Author

nzackoya commented Dec 4, 2023

test_geolocator.zip
Hey @TimHoogstrate ,
Thanks for your reply. Attached is main.dart, AndroidManifest.xml and pubsec.yaml(didn't want to attach whole 500 mb project) Just create a new project and replace them. After tapping on '+' button you'll get the permission dialog, after selecting "when in use" you'll be taken to the location permission settings of the app, where you can select "always". Then getting back to the app and tapping '+' again you'll see that Geolocator.requestPermission() doesn't return 'always'

@mvanbeusekom mvanbeusekom added type: bug Something isn't working P2 Important issues not at the top of the work list. labels Jan 15, 2024
@mvanbeusekom
Copy link
Member

Thank you for providing the additional information, I have labelled the issue as bug and added it to our backlog.

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. platform: android Issue is related to the Android platform. type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants