Closed paulwaweru-onmo closed 2 days ago
Hey @paulwaweru-onmo,
FACE auth on most Android devices is not considered strong biometrics, which is why the library does not return it. For more details, you can refer to the Android Developer Documentation on BiometricManager.Authenticators.
fun isStrongBiometricAuthAvailable(context: Context): Boolean {
return BiometricManager.from(context)
.canAuthenticate(BiometricManager.Authenticators.BIOMETRIC_STRONG) ==
BiometricManager.BIOMETRIC_SUCCESS
}
fun getSupportedBiometryType(promise: Promise) {
try {
var reply: String? = null
if (!DeviceAvailability.isStrongBiometricAuthAvailable(reactApplicationContext)) {
reply = null
} else {
if (isFingerprintAuthAvailable) {
reply = FINGERPRINT_SUPPORTED_NAME
} else if (isFaceAuthAvailable) {
reply = FACE_SUPPORTED_NAME
} else if (isIrisAuthAvailable) {
reply = IRIS_SUPPORTED_NAME
}
}
promise.resolve(reply)
}
// [...]
}
ahh, thank you so much for the quick response @DorianMazur! Learned a bit from this. Happy to close the issue in that case :)
Hi, I noticed the
getSupportedBiometryType
function returns{"biometryType": null}
for Android devices that support facial recognition. I'm using the Samsung Z Flip and I've setup biometrics with Face ID only, and I'm using the following logic:biometryType
is null andresult
is false. I've also specified the following in my Android manifest:Is there something I'm missing?