假设我在手机上设置了 FaceId。然后我在应用程序中注册了生物识别。一切正常。但是现在,当我添加另一个 FaceId,并且当我尝试再次登录时,它应该能够检测到已添加新的 FaceId,并且应该给我一个错误或其他信息。如何通过
react-native-biometrics
库来实现这一点。在android中,可以检测是否添加了新指纹,但在删除指纹时则无法检测到。但在ios中无法检测faceid是否被重置或添加了新的。
例如。代码
const checkKeyExist = yield rnBiometrics.biometricKeysExist()
if (checkKeyExist.keysExist) {
const epochTimeSeconds = Math.round(new Date().getTime() / 1000).toString()
try {
const createSignature = yield rnBiometrics.createSignature({
promptMessage: 'Sign in',
payload: epochTimeSeconds
})
} catch (err) {
// Should catch that error here
}
}
任何帮助将不胜感激
https://github.com/mergograiqevci/react-native-biometrics-changed
我认为这应该对你有帮助......通过这个库你可以检测生物识别的任何变化以反应本机