Skip to content

[iOS 14] Approximate location #558

Open

Description

@renefloor

🚀 Feature Requests

In iOS 14, when you prompt for location permissions, the user can toggle between Precise: On (precise location) and Precise: Off (approximate location). Precise location is the default.
https://radar.io/blog/understanding-approximate-location-in-ios-14

Contextualize the feature

The permission for location should be adapted, it should not only give (not) allowed, but also whether you have precise location or not.

Related ticket: Baseflow/flutter-geolocator/issues/736

Platforms affected (mark all that apply)

  • 📱 iOS
  • 🤖 Android

Activity

  1. added
    platform: ios
    type: enhancement
    P1
    on Aug 30, 2023
  2. JeroenWeener commented on Aug 30, 2023

    @JeroenWeener
    Contributor

    This issue is the iOS counterpart of #559.

  3. Pierre-Monier commented on Feb 3, 2025

    @Pierre-Monier

    I have worked on this, and it's working. I think we should discuss the design before I create a PR.

    Basically, I think we have two solutions for this:

    1. Create two new methods on the PermissionHandlerPlatform

      I can add two new methods: getLocationAccuracy and requestTmpPreciseLocation (the latter will only work on iOS).

      This is great because location accuracy somewhat looks like a permission, but in reality, it is not exactly a permission. However, this approach introduces two new methods, and users might find it counterintuitive.

      This is the solution adopted in react-native-permissions.

    2. Add a new permission Permission.locationPrecise

      We add a new permission to the Permission enum. For users, precise location will work like a regular permission, even if under the hood, it behaves differently. On the native side, we add some special logic to the LocationPermissionStrategy, and it will work.

      The only issue is with requestTmpPreciseLocation. The problem is that users must provide a specific key corresponding to their explanation of why the app needs temporary access to precise location. This means it won't fit the current API for permission requests, as it requires an extra parameter.

    I think the first option is better, but I want to discuss it before creating a PR, as it introduces two new methods.

    I'm going to work on the Android part once the iOS part is validated.

    Ongoing work can be found here.

  4. Pierre-Monier commented on Feb 10, 2025

    @Pierre-Monier

    I have implemented the first solution

  5. self-assigned this
    on Apr 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1platform: iostype: enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions