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

Error in Diagnostic plugin check for location permissions #776

Closed
nakioman opened this issue Nov 7, 2016 · 2 comments
Closed

Error in Diagnostic plugin check for location permissions #776

nakioman opened this issue Nov 7, 2016 · 2 comments

Comments

@nakioman
Copy link

nakioman commented Nov 7, 2016

Hi, I am trying to ask to see if I have permission to use the location for an android app, with the following code:

Diagnostic.requestLocationAuthorization(Diagnostic.locationAuthorizationMode.ALWAYS).then(status => { });
But I am having the following error in the console:

cordova.js:314 Uncaught TypeError: successCallback is not a function(…)onSuccess @ diagnostic.js:572onSuccess @ diagnostic.js:379callbackFromNative @ cordova.js:293(anonymous function) @ VM87:1

Could you help me?

@dpa99c
Copy link
Contributor

dpa99c commented Nov 7, 2016

The ionic-native wrapper is invoking the underlying requestLocationAuthorization() plugin function with parameters in the wrong order: the plugin function expects to be passed the arguments (successCallback, errorCallback, mode) but the ionic-native wrapper is passing (mode, successCallback, errorCallback) which is causing Cordova to throw the observed error.

ramonornela added a commit to ramonornela/ionic-native that referenced this issue Nov 8, 2016
@ramonornela
Copy link
Contributor

Thanks @dpa99c 😉 fix in ramonornela@608d00f

@ihadeed ihadeed closed this as completed in 01b30c6 Nov 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants