Baseflow / Baseflow/flutter-geolocator

[Android] Upgrade Approximate location to Precise location

Open
#1,150 1 comment 10 reactions 0 assignees View on GitHub
P2 platform: android type: enhancement
Dominant language
Dart
Stars
1.3k
Forks
803
Avg merge
8h 16m
Merged PRs (30d)
1

Description

## 🚀 Feature Requests

Relevant for Android 12+.
Add functionality to change an existing approximate location permission to precise, without leaving the app.

### Contextualize the feature

Calling `Geolocator.requestPermission()` will show the left dialog in the below image.
Click 'Approximate' and 'While using' to get a reduced location permission.

Given the reduced permission:
- Calling `Geolocator.requestPermission()` again won't do anything, as it will return `LocationPermission.whileInUse`.
- Using (your own) [permission_handler](https://pub.dev/packages/permission_handler) package, calling `Permission.locationWhenInUse.request()' will show the right dialog.

Can you add this trigger to Geolocator?

![permission](https://user-images.githubusercontent.com/11444698/195109016-8ce1d239-f4ae-4bcc-9df2-ca1b251179cd.jpg)

### Describe the feature
For a lot of applications approximate location isn't accurate enough, but users on Android 12 or above will get the choice to use it.
Android already has functionality to smoothly change this accuracy, it simply isn't triggered by Geolocator yet.

Given that there already is a `Geolocator.requestTemporaryFullAccuracy()` function for iOS, can't we get something similar for Android?
A separate function might be easier than adding it as implicit requestPermission behaviour, as it won't break any existing code.

### Platforms affected (mark all that apply)
- [ ] :iphone: iOS
- [x] :robot: Android

Contributor guide

Open the contributing guide

Research direction

Start with the Android implementation behind Geolocator.requestPermission() and compare it with the existing iOS Geolocator.requestTemporaryFullAccuracy() entry point. Check the Android 12+ permission behavior described in the issue and define completion as a supported trigger that upgrades an existing approximate permission to precise without leaving the app.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, dart
Domain
mobile-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.