Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
3 tasks done
expcapitaldev opened this issue Oct 6, 2022 · 10 comments

Comments

@expcapitaldev
Copy link

expcapitaldev commented Oct 6, 2022

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
@jcesarmobile
Copy link
Member

Can you provide a sample app and steps to reproduce?

@expcapitaldev
Copy link
Author

expcapitaldev commented Oct 18, 2022

@jcesarmobile I think sample app no need it is easy case.
About steps: I think you agree with me ,that if I add plugin in app and will change location access on ios from plugin will be called didChangeAuthorizationStatus -> startLocation.
If applicaiton status will be true here https://github.com/apache/cordova-plugin-geolocation/blob/master/src/ios/CDVLocation.m#L73 , from plugin will be call here https://github.com/apache/cordova-plugin-geolocation/blob/master/src/ios/CDVLocation.m#L124
and on ios system return kCLAuthorizationStatusNotDetermined status if you disable in all location services and after that enable

@jcesarmobile
Copy link
Member

If you want to get help you have to make it easier for people to help you, so if you provide a sample app there are more chances of getting help.

@expcapitaldev

This comment was marked as off-topic.

@expcapitaldev

This comment was marked as off-topic.

@jcesarmobile

This comment was marked as off-topic.

@expcapitaldev

This comment was marked as off-topic.

@expcapitaldev

This comment was marked as off-topic.

@jcesarmobile

This comment was marked as off-topic.

@expcapitaldev

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants