百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
R

react-native-biometrics

> 编程语言
开源

适用于 iOS 和 Android 生物识别的 React Native 模块

697 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

适用于 iOS 和 Android 生物识别的 React Native 模块

React-native-biometrics

React Native 生物识别技术是通向原生 iOS 和 Android 键储管理的简单桥梁。 它允许您创建存储在原生键储中的公私密钥对,并通过生物识别身份验证进行保护。 这些密钥随后可以在正确身份验证后进行检索,并用于创建加密签名。

React Native 兼容性

React-native-biometrics 版本 需要的 React Native 版本
>= 3.0.0 >= 0.60
`{
const { available, biometryType } = resultObject

if (available && biometryType === BiometryTypes.TouchID) { console.log('支持 TouchID') } else if (available && biometryType === BiometryTypes.FaceID) { console.log('FaceID 支持') } else if (available && biometryType === BiometryTypes.Biometrics) { console.log('支持生物识别') } else { console.log('不支持生物识别') } })


### createKeys()

Generates a public private RSA 2048 key pair that will be stored in the device keystore.  Returns a `Promise` that resolves to an object providing details about the keys.

__Result Object__

| Property | Type | Description |
| --- | --- | --- |
| publicKey | string | A base64 encoded string representing the public key |

__Example__

js import ReactNativeBiometrics from 'React-native-biometrics' const rnBiometrics = new ReactNativeBiometrics() rnBiometrics.createKeys() ).then((resultObject) => { const { publicKey } = resultObject console.log(publicKey) sendPublicKeyToServer(publicKey) })


### biometricKeysExist()

Detects if keys have already been generated and exist in the keystore.  Returns a `Promise` that resolves to an object indicating details about the keys.

__Result Object__

| Property | Type | Description |
| --- | --- | --- |
| keysExist | bool | A boolean indicating if keys exist in the keystore |

__Example__

js import ReactNativeBiometrics from 'React-native-biometrics' const rnBiometrics = new ReactNativeBiometrics() rnBiometrics.biometricKeysExist(

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Java

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言