NiklasMerz / cordova-plugin-fingerprint-aio

Cordova Plugin for fingerprint sensors (and FaceID) with Android and iOS support
https://www.npmjs.com/package/cordova-plugin-fingerprint-aio
MIT License
316 stars 189 forks source link

Faceid not support on android device #319

Open ifbbprochris opened 3 years ago

ifbbprochris commented 3 years ago

Bug report

the auth api return -106 error code, even when I turn on the face id

Environment

package version: 4.0.2

test device: android 9

Logs

fingerprintErr:{"code":-106,"message":"BIOMETRIC_NOT_ENROLLED"}
Max19901 commented 3 years ago

+1 I have the same problem. Samsung M20 supported FaceId a couple of days ago - updated plugin and no longer recognizes face

RonYaari commented 3 years ago

+1 I have the same problem with Samsung galaxy a8

oumaymasalhii commented 3 years ago

+1 I'm using android 10, and I register my face ID but when I invoke Fingerprint.isAvailable it returns the error BIOMETRIC_NOT_ENROLLED. and when I enroll my fingerprint it return success which means that the plugin doesn't support faceId authentication .

tdfeslo commented 3 years ago

Is there any update on this issue ?

fathanyr commented 3 years ago

Is there any update on this issue?

contfedorov commented 3 years ago

Tried to adopt this plugin in my code. My testing devices are the following. Both have fingerprint scanner and face recognition. Both have face screen unlock turned on, and it works well for this purpose.

Plugin utilizes standard Android API calls (from AndroidX support library):

Nevertheless, attempt to use it does nothing from user point of view.

  1. Checking biometric availability (call Fingerprint.isAvailable() in JS) results an error: { code: -106, message: BIOMETRIC_NOT_ENROLLED }
  2. Force showing auth dialog (call Fingerprint.show() in JS) results the same error. If I remove this check for availability in Java code, I get prompt with PIN, not with face recognition.

Possibly, problem may be somewhere in AndroidX internally. SO says:

Android Biometric APIs would only work on the devices which have their biometric features (face,fingerprint, iris) compatible with Android Biometric stack. I have a set of devices with Face feature support, among them only few support Android Biometrics.

Continue research.

contfedorov commented 3 years ago

@oumaymasalhii

+1 I'm using android 10, and I register my face ID but when I invoke Fingerprint.isAvailable it returns the error BIOMETRIC_NOT_ENROLLED. and when I enroll my fingerprint it return success which means that the plugin doesn't support faceId authentication .

Could you clarify what device do you use? I have the same error with my Xiaomi Mi 10 Lite (M2002J9E). It has face unlock, but plugin does not work with it. So, it doesn't mean that plugin have no FaceID support for Android. Plugin uses standard Android API provided by OS. Looks like this API does not work properly or device vendor did not provide correct implementation.

android-biometric-impl

scotthmusson commented 2 years ago

I also have this issue on a Samsung A11, would love to have this issue fixed if possible. If there's any information I can contribute that would help, I would be happy to do so.

patrikkelmen1 commented 2 years ago

same issue on galaxy tab A7, face recognition enabled and the plugin says BIOMETRIC_HARDWARE_NOT_SUPPORTED, will probably try to use some other plugin for face recognition on android

petercutting commented 2 years ago

IIUC this plugin performs as follows:-

@patrikkelmen1 did you find a workng face plugin for Android ?

patrikkelmen1 commented 2 years ago

@petercutting unfortunately not yet (I had other priorities - so I wasn't really looking)

pitAlex commented 2 years ago

Face ID in Android is not considered a strong biometric for most devices. That means it provides no cipher. We encounter this but in our case, it was just when trying to save the secret that it was failing and we just provided a fallback for such a situation. Now, this is the case in Android 12. I suspect in older versions (like 9) it will just say not supported and the cause will be from the android x library directly.

prajapatijay95 commented 1 year ago

I have solved the Android Face ID issue by modifying following files:

  1. cordova-plugin-src/cordova-plugin-fingerprint-aio/src/android/build.gradle Line 2: implementation "androidx.biometric:biometric:1.1.0"

https://developer.android.com/jetpack/androidx/releases/biometric#1.1.0

  1. cordova-plugin-src/cordova-plugin-fingerprint-aio/src/android/Fingerprint.java Line 139: int error = BiometricManager.from(cordova.getContext()).canAuthenticate(BiometricManager.Authenticators.BIOMETRIC_STRONG);

https://androidx.de/androidx/biometric/BiometricManager.html#canAuthenticate(int)

It does not cover all the devices though, here is the link to track this issue with google. FaceID authentication using BiometricPrompt from AndoidX library cant unlock cipher key

codehack26 commented 1 year ago

@prajapatijay95 I am facing an issue after doing the above changes

BiometricActivity.java:12: error: package does not exist import androidx.appcompat.app.AppCompatActivity;

How did you resolve this issue in BiometricActivity.java? Did you face the same issue? Can you please help me with it?

prajapatijay95 commented 1 year ago

@codehack26 Sorry for the late reply. I have not faced this issue. I just made a change to 2 files mentioned in my other comment. Maybe try it with gradle sync.

jdpsah commented 1 year ago

@prajapatijay95 I did the above two file changes but still getting { code: -106, message: BIOMETRIC_NOT_ENROLLED } can you pls help me how you resolved?

banushanv commented 2 weeks ago

I am using the Android 12 version of Samsung m31 , When I register secret get { code: -106, message: BIOMETRIC_NOT_ENROLLED } can you pls help me how to resolve this?