Baseflow / Baseflow/flutter-geolocator
[Bug] Geolocator.requestPermission() doesn't return (Android API 28)
- Dominant language
- Dart
- Stars
- 1.3k
- Forks
- 803
- Avg merge
- 8h 16m
- Merged PRs (30d)
- 1
Description
## 🐛 Bug Report
At Android API 30,everything is working fine all of the time.
At android API 28 (I test this dozens of times):
About half of the time, requestPermission works, but at the other half,Geolocator.requestPermission() doesn't return not shows anything to the user. Curiously, when the app state changes and upon resuming, it suddenly decides to ask the user for a permission (In some tests I have waited 2 minutes before putting the app in the background,so it isn't about time).
See https://youtube.com/shorts/j60CfVZDsyE?feature=share
### Expected behavior
Ask permissions from the user all of the time (and not half of the time)? :D
### Reproduction steps
Call Geolocator.requestPermission() on an Android API 28 emulator. Possibly not working on other Android APIs (didn't test), note that on android 30 it is working all of the time.
### Configuration
**Version:** 9.0.1
**Platform:**
- [ ] :iphone: iOS
- [X] :robot: Android
Contributor guide
Research direction
Start by reproducing Geolocator.requestPermission() on an Android API 28 emulator and compare its behavior with API 30, including after the app resumes. Inspect the Android permission flow in the plugin; done means the request consistently returns and prompts the user without requiring an app-state change.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, dart, flutter
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100