You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not able to reproduce this - requestLocationAuthorization is working fine when used in the example example project. Tested on iOS 7.0, 8.0, 9.1
So first I'd suggest to try building+running the example project to confirm that the plugin works OK in your build environment. Then I'd suggest using Safari to remote debug the WebView in your app and insert a breakpoint on the console.error(error); line to see if error is indeed undefined. If so, run the app via Xcode and see if there's any error in the Objective-C log output.
Figure out the problem
For iOS 8 and above, your app must have a value for NSLocationAlwaysUsageDescription in its Info.plist
Adding
NSLocationWhenInUseUsageDescription
This app will now only track your location when the screen is on and the app is displayed.
NSLocationAlwaysUsageDescription
This app requires constant access to your location in order to track your position, even when the screen is off.
When using requestLocationAuthorization in iOS with and without passing in "when_in_use"
cordova.plugins.diagnostic.requestLocationAuthorization(function(){
console.log("Successfully requested location authorization always");
}, function(error){
console.error(error);
}, "when_in_use");
Error in Error callbackId: Diagnostic786250294 : ReferenceError: Can't find variable: error
The text was updated successfully, but these errors were encountered: