尝试在世博会中使用FaceId。文件如下:
https://docs.expo.dev/versions/latest/sdk/local-authentication/
它看起来与托管应用程序兼容。但是当我在我的项目中尝试它时,它会返回错误“by中没有Face,您可以通过提供NSFaceIDUsageDescription在一个独立的世博会应用程序中使用它。”
我正在用博览开始工作测试应用在我的手机上。(这是怎么回事?)
这是我的密码:
import * as LocalAuthentication from 'expo-local-authentication';
const onFaceId = async () => {
try {
// Checking if device is compatible
const isCompatible = await LocalAuthentication.hasHardwareAsync();
if (!isCompatible) {
alert('Your device isn\'t compatible.')
}
// Checking if device has biometrics records
const isEnrolled = await LocalAuthentication.isEnrolledAsync();
if (!isEnrolled) {
alert('No Faces / Fingers found.')
}
// Authenticate user
await LocalAuthentication.authenticateAsync();
console.log(LocalAuthentication)
alert('Authenticated', 'Welcome back !')
} catch (error) {
alert('An error as occured', error?.message);
}};
这难道不可能在世博会管理的应用程序中使用FaceID吗?
发布于 2022-04-20 20:25:39
这可能有点让人困惑。基本上,expo应用程序是在使用expo命令时打开的。这是你基本上运行你的应用程序在博览去应用程序。根据消息,您需要创建一个独立的应用程序(https://docs.expo.dev/build/setup/),从那里可以运行face,而不是在expo应用程序中运行它。
https://stackoverflow.com/questions/71006618
复制相似问题