ionic-team / ionic-team/capacitor-geolocation
Split application permissions and device permissions into seperate checks
- Dominant language
- Swift
- Stars
- 12
- Forks
- 19
- PR merge metrics
- No merged PRs in 30d
Description
## Feature Request
### Plugin
Geolocation
### Description
In order to check whether a user has allowed the app permission to access location we have to have them first turn on the device geolocation permission. While both are needed to request an actual location (getCurrentPosition), there is no reason that a user needs to enable the device location in order to read the state of the app permission. This causes extra steps and confusion in order to display the current permissions and prompt for allowing permissions if needed.
### Platform(s)
All
### Preferred Solution
Split the Geolocation.checkPermissions() function into multiple functions:
Geolocation.checkAppPermissions() - Checks if the user has enabled accessing location to the application
Geolocation.checkDevicePermissions() - Checks if the user has turned on Location functionality for the whole device.
Possibly a backwards compatibility function, deprecated, as well as a helper that wraps the two in order to check if calls to getCurrentPosition and the other functions will succeed.
### Alternatives
### Additional Context
requestPermissions probably also needs to be split up in a similar fashion.
Contributor guide
Assessment
This issue has not been assessed yet.