gpt4 book ai didi

react-native - 如何在 React-Native 中检查 Touch ID、Face Id、密码和模式锁定的支持

转载 作者:行者123 更新时间:2023-12-04 12:50:21 25 4
gpt4 key购买 nike

我已经实现了 react-native-fingerprint-scanner ,它适用于 Touch Id .

现在我想为 添加身份验证两个平台的 Touch ID、Face ID、密码

有什么方法可以检查您的设备是否支持。另外,我尝试使用 react-native-touch-id但它不适用于 Face Id在安卓上。

有没有办法在两个平台(iOS/Android)上实现这一点?

引用:Link

enter image description here

enter image description here

最佳答案

react-native-touch-id应该适用于 TouchID 和 FaceID。

iOS allows the device to fall back to using the passcode, if faceid/touch is not available. this does not mean that if touchid/faceid fails the first few times it will revert to passcode, rather that if the former are not enrolled, then it will use the passcode.



from the docs

您可以先检查它是否受支持。
const optionalConfigObject = {
fallbackLabel: 'Show Passcode',
passcodeFallback: true,
}

TouchID.isSupported(optionalConfigObject)
.then(biometryType => {
// Success code
if (biometryType === 'FaceID') {
console.log('FaceID is supported.');
} else {
console.log('TouchID is supported.');
}
})
.catch(error => {
// Failure code
console.log(error);
});

关于react-native - 如何在 React-Native 中检查 Touch ID、Face Id、密码和模式锁定的支持,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58218710/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com