react-native - 错误:LAErrorAuthenticationFailed 身份验证无法启动,因为 Touch ID 没有注册手指。反应原生
问题描述
我正在尝试使用react-native-touch-id将 TouchId 集成到 React-native 中,并且我具有检查是否 TouchID.isSupported()
支持它的功能,但它TouchID.authenticate()
不起作用
这是我的代码
const clickHandler = () => {
TouchID.isSupported()
.then(() => {
console.log('yes'); // it console yes
authenticate();
})
.catch(error => {
Alert.alert('TouchID not supported');
});
};
const authenticate = () => {
return TouchID.authenticate()
.then(success => {
Alert.alert('Authenticated Successfully');
})
.catch(error => {
console.log(error); // it console Authentication could not start because Touch ID has no enrolled fingers.]
Alert.alert(error.message);
});
}; 任何线索是什么问题?或者解决方案?