You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reacted by Štěpán Záliš, aiqianxian, OliverNarramore, Julian Steenbakker, Yury Kostov, Chris Wickens, Ryotaro Onoue, Peter Leibiger, Kauê Martins and ksatou
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:
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.
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.
Activity
JeroenWeener commentedon Aug 30, 2023
This issue is the iOS counterpart of #559.
Pierre-Monier commentedon Feb 3, 2025
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:
Create two new methods on the
PermissionHandlerPlatformI can add two new methods:
getLocationAccuracyandrequestTmpPreciseLocation(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.Add a new permission
Permission.locationPreciseWe add a new permission to the
Permissionenum. 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 theLocationPermissionStrategy, 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.
Pierre-Monier commentedon Feb 10, 2025
I have implemented the first solution