From 06019a1e4b1ac00d68b444d5d249a3a84f5565c4 Mon Sep 17 00:00:00 2001 From: anghuang <13986366574@163.com> Date: Thu, 30 May 2024 11:43:25 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20[Issues:=20#I9TDMB]=20=E6=9B=B4?= =?UTF-8?q?=E6=96=B0react-native-fingerprint-scanner.md=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zh-cn/react-native-fingerprint-scanner.md | 251 ++++++++++++++++++++++ 1 file changed, 251 insertions(+) create mode 100644 zh-cn/react-native-fingerprint-scanner.md diff --git a/zh-cn/react-native-fingerprint-scanner.md b/zh-cn/react-native-fingerprint-scanner.md new file mode 100644 index 00000000..c29f9c9c --- /dev/null +++ b/zh-cn/react-native-fingerprint-scanner.md @@ -0,0 +1,251 @@ +> 模板版本:v0.2.1 + +

+

react-native-fingerprint-scanner

+

+

+ + Supported platforms + + + License + +

+ +> [!tip] [Github 地址](https://github.com/react-native-oh-library/react-native-fingerprint-scanner) + +## 安装与使用 + +请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-tpl/react-native-fingerprint-scanner Releases](https://github.com/react-native-oh-library/react-native-fingerprint-scanner/releases),并下载适用版本的 tgz 包。 + +进入到工程目录并输入以下命令: + +> [!TIP] # 处替换为 tgz 包的路径 + + + +#### **npm** + +```bash +npm install @react-native-oh-tpl/react-native-fingerprint-scanner@file:# +``` + +#### **yarn** + +```bash +yarn add @react-native-oh-tpl/react-native-fingerprint-scanner@file:# +``` + + + +快速使用: + +> [!WARNING] 使用时 import 的库名不变。 + +```js +import { View, Button } from "react-native"; +import FingerprintScanner from 'react-native-fingerprint-scanner'; + +export default function App() { + const handleClick = () => { + FingerprintScanner + .isSensorAvailable() + .then((Biometrics) => { + }).catch((err) => { + }); + } + const handleScanner = () => { + FingerprintScanner.authenticate({title: '1111'}) + .then(() => { + }).catch((err) => { + }); + } + const handleAttempt = () => { + let eror = FingerprintScanner.onAttempt() + } + const handleRelease = () => { + FingerprintScanner.release() + } + return ( + +