gpt4 book ai didi

javascript - Expo.Fingerprint.isEnrolledAsync 返回一个对象

转载 作者:行者123 更新时间:2023-11-29 00:09:12 25 4
gpt4 key购买 nike

我正在尝试在我的 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/

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