EddyVerbruggen / cordova-plugin-touch-id

:nail_care: 👱‍♂️ Forget passwords, use a fingerprint scanner!
MIT License
214 stars 72 forks source link

isAvailable getting null value as response #9

Closed rakeshpalivela closed 8 years ago

rakeshpalivela commented 8 years ago

I am getting an issue in callback function. When I checked in plugin the CDVCommandStatus_OK was returning "1". But, in JS success response I am getting null value.

[self.commandDelegate sendPluginResult:[CDVPluginResult resultWithStatus:CDVCommandStatus_OK] callbackId:command.callbackId];

eg:- window.plugins.touchid.isAvailable( function(msg) {alert('ok: ' + msg)}, // msg I am getting Null value function(msg) {alert('not ok: ' + msg)} // error handler: no TouchID available );

EddyVerbruggen commented 8 years ago

Hey @rakeshpalivela that null is correct as invoking the success handler is sufficient for knowing that TouchID is available. I've updated the readme examples accordingly because they should have been more clear.

Note that in retrospect I may have changed that API a bit but it is what it is and it's been this way since the first release.