12

I was implementing biometrics in my app for authentication. I am using react-native biometrics for it. Every things working good just one stucked. Face-id is not working in Android. I did a lot of googling but unable to find some satisfactory answer. Is it even possible to use face-id in Android?

Biometrics.isSensorAvailable()
  .then((biometryType) => {
    if (biometryType === Biometrics.TouchID) {
      console.log('TouchID is supported')
    } else if (biometryType === Biometrics.FaceID) {
      console.log('FaceID is supported')
    } else {
      console.log('Biometrics not supported')
    }
  })  

This always return me TouchId even if I am using FaceId in my phone. Thank for help in advance.

Bhaskar Joshi
  • 413
  • 7
  • 18

5 Answers5

3

I think this is because Face-Id and Touch-Id are iOS only. and you still seem to get Touch-Id working as Biometrics on android defaults to what you are using for your lock screen (sometimes it also depends on your device manufacturer) I got this info from here

Amitoj Singh
  • 59
  • 1
  • 3
1

My straight answer would be NO. The justification for that is because Android has never shipped FaceID/Face unlock from its own in the Stock version or core API. The Face ID/Face unlock solutions we get in android are from vendors which they have indulged in android on top of the core APIs as third-party integration and I assume no one can write an interface on top of hundreds of different implementations to support such feature from a single API.

Suraj Malviya
  • 3,685
  • 1
  • 15
  • 22
0

Refer to this answer

react-native-touch-id should work for both TouchID and FaceID.

Refer to this documentation

This package requires a compiled SDK version of 29 (Android 10.0) or higher

this might be indicate that it will work only on android 10 or higher.

Mayank Kumar Chaudhari
  • 16,027
  • 10
  • 55
  • 122
0

using lib react-native-biometrics support touchid & faceid for Android

phuocantd
  • 452
  • 4
  • 12
  • This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/30779861) – smaudet Jan 15 '22 at 01:37
0

From my recent research it seems that expo-local-authentication works with face recognition, but only if device has fingerprint authentication hardware also.

Expo-local-authentication function supportedAuthenticationTypesAsync() returns always only information about AuthenticationType.FINGERPRINT even if facial recognition is also available on android device. Despite that it works properly even if device with fingerprint hardware doesn't have fingerprint data and has only face data. Then expo-local-authentication use face unlock.

Problem happens when android device doesn't have fingerprint hardware, but have face recognition availability. Then supportedAuthenticationTypesAsync() returns only undefined and authenticateAsync() doesn't work.

Here is snack created for testing: https://snack.expo.dev/-Y34x2K7- But you will need a device with such hardware.

I prepared precise question here to find solution for case with android devices with face recognition unlock but without fingerprint unlock here: Face Id, biometry, face recognition unlock on Android devices in React Native

Piotr Witkoś
  • 334
  • 3
  • 10