我需要使用指纹和人脸身份验证集成生物识别身份验证。指纹身份验证工作完美,但是当我只设置人脸身份验证时,我得到来自 BiometricManager.from(context) 方法的生物识别未注册响应,如下所示,
val biometricManager = BiometricManager.from(context)
when(biometricManager.canAuthenticate()){
BiometricManager.BIOMETRIC_SUCCESS ->{
Log.e(TAG, "App can authenticate using biometrics.")
}
BiometricManager.BIOMETRIC_ERROR_NO_HARDWARE ->{
Log.d(TAG, "Hardware not available")
}
BiometricManager.BIOMETRIC_ERROR_HW_UNAVAILABLE ->{
Log.d(TAG, "Biometric features are currently unavailable.")
}
BiometricManager.BIOMETRIC_ERROR_NONE_ENROLLED ->{
Log.d(TAG, "The user hasn't associated any biometric credentials with their account.")
}
else ->{
Log.d(TAG, "Nothing supported")
}
}