apache / apache/cordova-plugin-geolocation

[iOS permission bug] wrong logic in didChangeAuthorizationStatus hook, permission can be asked in some unexpected cases

Open
#253 10 comments 1 reaction 0 assignees View on GitHub
info-needed
Dominant language
JavaScript
Stars
646
Forks
654
PR merge metrics
No merged PRs in 30d

Description

# Bug Report
iOS native permission can be asked in some unexpected cases and **iOS app can be declined in App Store** and **it is can be affect user experience with unexpected cases**, if we will ask client about location access but now user do not use any location features.
## Problem
If plugin added but if you did not call yet any methods, for example "watchPosition", plugin can ask iOS permission, see https://github.com/apache/cordova-plugin-geolocation/blob/master/src/ios/CDVLocation.m#L363
### What is expected to happen?
We do not need to call "startLocation" if __locationStarted="NO".
Because only if anyone call "watchPosition" only now we need to check permission and ask user, in other cases user can see native location permission but it is not expected in all

### Version information
last plugin version and iOS version is 16.0

## Checklist

- [x] I searched for existing GitHub issues
- [x] I updated all Cordova tooling to most recent version
- [x] I included all the necessary information above

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.