EddyVerbruggen / nativescript-fingerprint-auth

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

getSystemService("fingerprint") ? #37

Closed RoyiNamir closed 6 years ago

RoyiNamir commented 6 years ago

Hi.

Is there any reason for this line ?

 const fingerprintManager = utils.ad.getApplicationContext().getSystemService("fingerprint");

IMHO it should be

  const fingerprintManager = getApplicationContext().getSystemService(android.content.Context.FINGERPRINT_SERVICE);

(i'm referring to "fingerprint" vs android.content.Context.FINGERPRINT_SERVICE)

Which does exists in 23 ( for example)

image

It's just that I got a null reference

image

for this line :

  var fingerprintManager = utils.ad.getApplicationContext().getSystemService("fingerprint");
                if (!fingerprintManager.isHardwareDetected()) {       <--- here
                    reject("Device doesn't support fingerprint authentication");
                }