作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试在我的 React native 应用程序上创建指纹身份验证过程。我使用了 Expo 的以下 SDK 来实现它。
https://docs.expo.io/versions/latest/sdk/fingerprint.html#returns-1
Expo.Fingerprint.authenticateAsync() 方法表明它将返回一个 bool 值。但是,当我尝试将其打印出来时,它似乎返回了一个对象。
Expo.Fingerprint.authenticateAsync()
.then(success => {
if(result == true) {
console.log("Touch ID success. " + result);
} else {
console.log("Touch ID failed. " + result);
}
});
有没有人遇到过和我一样的问题?
最佳答案
该函数返回一个嵌入了 bool 值的对象。您可以通过这种方式访问它。
Expo.Fingerprint.authenticateAsync()
.then(result => {
console.log(result.success);
});
关于javascript - Expo.Fingerprint.isEnrolledAsync 返回一个对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47066990/
我正在尝试在我的 React native 应用程序上创建指纹身份验证过程。我使用了 Expo 的以下 SDK 来实现它。 https://docs.expo.io/versions/latest/s
我是一名优秀的程序员,十分优秀!