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

Unable to call locationAccuracy.request once is cancel #16

Closed
jsalinaspolo opened this issue Sep 3, 2016 · 2 comments
Closed

Unable to call locationAccuracy.request once is cancel #16

jsalinaspolo opened this issue Sep 3, 2016 · 2 comments
Labels

Comments

@jsalinaspolo
Copy link

jsalinaspolo commented Sep 3, 2016

Once cordova.plugins.locationAccuracy.request is called, if the user press cancel on the dialog then calling again cordova.plugins.locationAccuracy.request is not working.

At least it is not working in iOS.

Also is not working in your example project https://github.com/dpa99c/cordova-plugin-request-location-accuracy-example

@dpa99c
Copy link
Owner

dpa99c commented Sep 8, 2016

If the user presses Cancel, iOS does not allow the app to invoke the dialog again. Instead, requesting a location results in an error in the native location manager. However, the plugin should at least differentiate this error from a successful call to invoke the dialog.

@dpa99c dpa99c added the todo label Sep 8, 2016
@dpa99c
Copy link
Owner

dpa99c commented Sep 8, 2016

Actually, having tested it, there's no way to distinguish between the request being successful and the dialog being shown, or the request failing to show the dialog because the user previously pressed Cancel.
In both cases, the location manager invokes didFailWithError with an error value of "null".

So there's no way to tell if the request was successful in showing the dialog, or if the dialog failed to appear because the user previously pressed Cancel. Thanks Apple.

The best I can do is to document this as a caveat of using the plugin.

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

No branches or pull requests

2 participants