EddyVerbruggen / nativescript-fingerprint-auth

:nail_care: 👱‍♂️ Forget passwords, use a fingerprint scanner or facial recognition!
MIT License
134 stars 33 forks source link

fingerprint-auth.available: TypeError: Cannot read property 'isHardwareDetected' of null #73

Open cloudhx opened 4 years ago

cloudhx commented 4 years ago

When running my app on a new Android 9 device (previously running on Android 7 without this problem), it reports the following error:

fingerprint-auth.available: TypeError: Cannot read property 'isHardwareDetected' of null

Method isHardwareDetected was added in API level 23 and deprecated in API level 28 which is Android 9 Pie, I was thinking this might be an issue for API level 28 and later versions.

TPham92 commented 4 years ago

Any updates on this issue?

Pandishpan commented 4 years ago

I'm experiencing the same issue on Android 9, Phone Model SM-A105FN (PPR1.180610.011) (this model doesn't have a fingerprint sensor?)

Uncaught (in promise): TypeError: Cannot read property 'isHardwareDetected' of null TypeError: Cannot read property 'isHardwareDetected' of null

However, I can't replicate the same issue on a phone with the same Android version but with a fingerprint sensor. I think this is happening if the phone doesn't have a fingerprint sensor and the API level is 28 or higher.

cloudhx commented 4 years ago

Thanks @Pandishpan I think it makes sense, I will check my devices and also see if there is a way to catch the exception in this case.

erjdriver commented 4 years ago

+1.

Phone is without fingerprint sensor but with faceid.

The error seems to be in fingerprint-auth.android.js - a simple check for fingerprintManager not being undefined would fix the issue.

I assume that the android version of the plugin doesn't support face-id - because I don't see any code related to it.