EddyVerbruggen / cordova-plugin-touch-id

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

The error callback of isAvailable doesn't receives the type of biometric ID #52

Open Christina-Popova opened 6 years ago

Christina-Popova commented 6 years ago

In case when device has a Touch ID or FaceID, but no fingerprints yet, isAvailable() calls the error handler with result: {"localizedDescription":"No identities are enrolled.","code":-7 }. How I can determine type of biometric ID - 'touch' or 'face' in this case? Thanks!

WuglyakBolgoink commented 5 years ago

@Christina-Popova

try this:

window.plugins.touchid.isAvailable(
  function(type) {alert(type)}, // type returned to success callback: 'face' on iPhone X, 'touch' on other devices
  function(msg) {alert('not available, message: ' + msg)} // error handler: no TouchID available
);