SelfLender / react-native-biometrics

React Native module for iOS and Android biometrics
MIT License
664 stars 228 forks source link

FACE RECOGNITION does not work on Android platform and Huawei EMUI #241

Open despotes opened 1 year ago

despotes commented 1 year ago

Description

The FACE RECOGNITION is currently not functioning properly on two Android devices:

  1. Samsung A42 5G running Android 12
  2. Huawei P40 Lite with EMUI 12.0 (based on Android 10)

This feature was working correctly on the Samsung A42 5G device when using version 2.1.4 of the library, but not on Huawei device and we tried to update the library to 3.0.1

Now we are using:

{
  // ...
  "react-native-biometrics": "^3.0.1",
  "react-native": "0.66.0",
  // ...
}

When only enabling FACE RECOGNITION at the operating system level, the values of available and biometryType returned by the isSensorAvailable method are false and undefined, respectively.

const rnBiometrics = new ReactNativeBiometrics();
const { available, biometryType } = await rnBiometrics.isSensorAvailable();
console.log('biometrics available:',  available)
console.log('biometrics type: ', biometryType)

Expected Behaviour

The FACE RECOGNITION feature should be functioning properly on both devices, with the available value being set to true and the biometryType being set to the correct type (e.g. biometrics).

Additional Context

Please note that the values of available and biometryType are correctly displayed when setting fingerprint recognition on the device. The problem occurs only if we set ONLY FACE RECOGNITION. This suggests that the issue is specific to the face recognition functionality.

Also, if we have both authentication methods set on our device, the library let use utilize only FINGERPRINT AUTHENTICATION.

MDG-MMeksasi commented 1 year ago

https://github.com/SelfLender/react-native-biometrics/issues/125#issuecomment-1139705609 I don't know if that's a correct answer

phamhieu1412 commented 1 year ago

same iss on oppo and samsung device, :((, what is your solution??

minkiapps commented 1 year ago

OEM ilke Huawei doesn't support face recognition in default biometric API like androidx.biometric. You have to use Huawei Fidokit and builld your own UI for that. Look at my example.

ferasabufares commented 1 year ago

@despotes did you find any solution for this ?

ZukaGap commented 1 year ago

Try this patch, working both face id and finger print

https://github.com/ZukaGap/react-native-biometrics-3.0.1/tree/main

YanaSyritskaya commented 1 year ago

@ZukaGap Hi, the patch is not working, getting [Error: Error displaying local biometric prompt: isRequiredConfirmation]. Has anybody found the solution?

leovido commented 1 year ago

@ZukaGap Hi, the patch is not working, getting [Error: Error displaying local biometric prompt: isRequiredConfirmation]. Has anybody found the solution?

I get the same error on a Xiaomi device

usmanabid94 commented 1 year ago

Hi, Unable to do face recognition on Samsung pixel or sony device does this library actually supports using facial recognition for android devices??

learncourse555 commented 4 months ago

Hi @despotes , Have u gotten fix for the issue ??