This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.
Expo LocalAuthentication
一个库,提供用于实现 Fingerprint API (Android) 或 FaceID 和 TouchID (iOS) 的功能,以通过面部或指纹扫描对用户进行身份验证。
expo-local-authentication 允许你使用生物识别提示(Android)或 FaceID 和 TouchID(iOS)通过指纹或面部扫描验证用户身份。
已知限制
🌐 Known limitation
iOS iOS
Expo Go 不支持 iOS 的 FaceID 验证。你需要创建一个开发版本来测试 FaceID。
🌐 The FaceID authentication for iOS is not supported in Expo Go. You will need to create a development build to test FaceID.
安装
🌐 Installation
If you are installing this in an existing React Native app, make sure to install expo in your project.
应用配置中的配置
🌐 Configuration in app config
如果你在项目中使用配置插件(连续原生生成 (CNG)),你可以使用其内置的 配置插件 来配置 expo-local-authentication。该插件允许你配置在运行时无法设置、需要构建新的应用二进制文件才能生效的各种属性。如果你的应用未使用 CNG,则需要手动配置该库。
🌐 You can configure expo-local-authentication using its built-in config plugin if you use config plugins in your project (Continuous Native Generation (CNG)). The plugin allows you to configure various properties that cannot be set at runtime and require building a new app binary to take effect. If your app does not use CNG, then you'll need to manually configure the library.
Example app.json with config plugin
Configurable properties
应用接口
🌐 API
import * as LocalAuthentication from 'expo-local-authentication';
No API data file found, sorry!
权限
🌐 Permissions
安卓
🌐 Android
通过此库的 AndroidManifest.xml 会自动添加以下权限:
🌐 The following permissions are added automatically through this library's AndroidManifest.xml:
iOS
该库使用以下用法描述键:
🌐 The following usage description keys are used by this library: