dpa99c / cordova-plugin-request-location-accuracy

Cordova/Phonegap plugin for Android and iOS to request enabling/changing of Location Services by triggering a native dialog

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to call locationAccuracy.request once is cancel

jsalinaspolo opened this issue · comments

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

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.

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.