sjhoeksma / cordova-plugin-keychain-touch-id

Touch ID plugin with saving password in keychain for IOS and android
87 stars 160 forks source link

var serviceName = (biometryType === "face") ? "Face ID" : "Touch ID" #58

Open MatthewPringle opened 5 years ago

MatthewPringle commented 5 years ago

For those who care, on Android such as the S8 where it has fingerprint and face biometrics, it returns "OK" rather than "face" or "touch"

Lirianna commented 5 years ago

For those who care, on Android such as the S8 where it has fingerprint and face biometrics, it returns "OK" rather than "face" or "touch"

Hi @MatthewPringle,

Thank you for your comment. It really helped me 👍 Do you have a solution for Android phone, where it returns "OK"? I want to open the face authentication window, when both face and touch is enabled. Right now, it opens touch when the biometryType === "OK".

I have tried to write var serviceName = (biometryType === "OK") ? "Face ID" : "Touch ID" just to debug this issue, but the device still opens the touch authentication window 😞

Any suggestions?

MatthewPringle commented 5 years ago

Hey @Lirianna I just default to saying "Biometric ID" where I can't get which service the phone is going to provide. At least that way the user doesn't see the words "Touch" or "Face" when I dont know which one will be presented to the user.

/* Touch ID */
if ( this.get( 'type' ) === 'touch' ) {
    return 'Touch ID';

/* Face ID */
} else if ( this.get( 'type' ) === 'face' ) {
    return 'Face ID';

/* Biometric ID */
} else {
    return 'Biometric ID';
}