Skip to content

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

@expcapitaldev

Description

@expcapitaldev

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

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions