{"id":13777439,"url":"https://github.com/hieuvp/react-native-fingerprint-scanner","last_synced_at":"2026-01-18T06:33:22.383Z","repository":{"id":21526562,"uuid":"93146336","full_name":"hieuvp/react-native-fingerprint-scanner","owner":"hieuvp","description":"Provide Fingerprint, Touch ID, and Face ID Scanner for React Native (Compatible with both Android and iOS)","archived":false,"fork":false,"pushed_at":"2023-03-23T14:21:03.000Z","size":2469,"stargazers_count":891,"open_issues_count":76,"forks_count":305,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-10-21T20:47:38.998Z","etag":null,"topics":["android","auth","authenticate","authentication","face","face-id","faceid","fingerprint","fingerprint-scanner","ios","meizu","react","react-native","samsung","touch","touch-id","touchid"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/react-native-fingerprint-scanner","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hieuvp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-06-02T08:46:10.000Z","updated_at":"2025-09-11T16:02:25.000Z","dependencies_parsed_at":"2023-01-16T20:46:46.782Z","dependency_job_id":"6ec9c0d4-ad2e-4137-9a70-4d07c0ff08a1","html_url":"https://github.com/hieuvp/react-native-fingerprint-scanner","commit_stats":{"total_commits":198,"total_committers":36,"mean_commits":5.5,"dds":"0.48989898989898994","last_synced_commit":"3898597b031ebf4b2f685958b7de0a755bb8fb16"},"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"purl":"pkg:github/hieuvp/react-native-fingerprint-scanner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hieuvp%2Freact-native-fingerprint-scanner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hieuvp%2Freact-native-fingerprint-scanner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hieuvp%2Freact-native-fingerprint-scanner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hieuvp%2Freact-native-fingerprint-scanner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hieuvp","download_url":"https://codeload.github.com/hieuvp/react-native-fingerprint-scanner/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hieuvp%2Freact-native-fingerprint-scanner/sbom","scorecard":{"id":464333,"data":{"date":"2025-08-11","repo":{"name":"github.com/hieuvp/react-native-fingerprint-scanner","commit":"3898597b031ebf4b2f685958b7de0a755bb8fb16"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.2,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":8,"reason":"Found 6/7 approved changesets -- score normalized to 8","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":9,"reason":"binaries present in source code","details":["Warn: binary detected: examples/android/gradle/wrapper/gradle-wrapper.jar:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"24 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-v8v8-6859-qxm4","Warn: Project is vulnerable to: GHSA-4xcv-9jjx-gfj3","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-r683-j2x4-v87g","Warn: Project is vulnerable to: GHSA-5fw9-fq32-wv5p","Warn: Project is vulnerable to: GHSA-76c9-3jph-rj3q","Warn: Project is vulnerable to: GHSA-rxrc-rgv4-jpvx","Warn: Project is vulnerable to: GHSA-7f53-fmmv-mfjv","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg","Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p","Warn: Project is vulnerable to: GHSA-g4rg-993r-mgx7","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp","Warn: Project is vulnerable to: GHSA-7mhc-prgv-r3q4","Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22","Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T12:03:37.590Z","repository_id":21526562,"created_at":"2025-08-19T12:03:37.590Z","updated_at":"2025-08-19T12:03:37.590Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28531997,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"online","status_checked_at":"2026-01-18T02:00:07.578Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","auth","authenticate","authentication","face","face-id","faceid","fingerprint","fingerprint-scanner","ios","meizu","react","react-native","samsung","touch","touch-id","touchid"],"created_at":"2024-08-03T18:00:43.369Z","updated_at":"2026-01-18T06:33:22.354Z","avatar_url":"https://github.com/hieuvp.png","language":"Java","funding_links":[],"categories":["\u003ca name=\"Security-\u0026-Auth:-Native-Modules\"\u003eSecurity \u0026 Auth: Native Modules\u003c/a\u003e","Java"],"sub_categories":[],"readme":"# React Native Fingerprint Scanner\n\n# Looking for Maintainers\n\nThis project is no longer actively maintained by the previous maintainers.\nIf you would like to propose a PR we can merge it though, it needs your effort to continue!\n\n----\n\n\n[![React Native Version](https://img.shields.io/badge/react--native-latest-blue.svg?style=flat-square)](http://facebook.github.io/react-native/releases)\n[![Version](https://img.shields.io/npm/v/react-native-fingerprint-scanner.svg)](https://www.npmjs.com/package/react-native-fingerprint-scanner)\n[![NPM](https://img.shields.io/npm/dm/react-native-fingerprint-scanner.svg)](https://www.npmjs.com/package/react-native-fingerprint-scanner)\n\nReact Native Fingerprint Scanner is a [React Native](http://facebook.github.io/react-native/) library for authenticating users with Fingerprint (TouchID).\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Compatibility](#compatibility)\n- [Example](#example)\n- [API](#api)\n- [License](#license)\n\n### iOS Version\nThe usage of the TouchID is based on a framework, named **Local Authentication**.\n\nIt provides a **Default View** that prompts the user to place a finger to the iPhone’s button for scanning.\n\n\u003cdiv\u003e\n\u003cimg src=\"https://github.com/hieuvp/react-native-fingerprint-scanner/raw/master/screenshots/ios-availability.png\" height=\"600\"\u003e\n\u003cimg src=\"https://github.com/hieuvp/react-native-fingerprint-scanner/raw/master/screenshots/ios-authentication.gif\" height=\"600\"\u003e\n\u003c/div\u003e\n\n### Android Version\n4.0.0 Prefers the new native Android BiometricPrompt lib on any Android \u003e= v23 (M)\n4.0.0 also DEPRECATES support for the legacy library that provides support for Samsung \u0026 MeiZu phones\n\n3.0.2 and below: \nUsing an expandable Android Fingerprint API library, which combines [Samsung](http://developer.samsung.com/galaxy/pass#) and [MeiZu](http://open-wiki.flyme.cn/index.php?title=%E6%8C%87%E7%BA%B9%E8%AF%86%E5%88%ABAPI)'s official Fingerprint API.\n\nSamsung and MeiZu's Fingerprint SDK supports most devices which system versions less than Android 6.0.\n\n\u003cdiv\u003e\n\u003cimg src=\"https://github.com/hieuvp/react-native-fingerprint-scanner/raw/master/screenshots/android-availability.png\" height=\"600\"\u003e\n\u003cimg src=\"https://github.com/hieuvp/react-native-fingerprint-scanner/raw/master/screenshots/android-authentication.gif\" height=\"600\"\u003e\n\u003c/div\u003e\n\n## Installation\n\n```sh\n$ npm install react-native-fingerprint-scanner --save\n```\nor\n```sh\n$ yarn add react-native-fingerprint-scanner\n```\n\n### Automatic Configuration\nFor RN \u003e= 0.60\n```sh\n$ cd ios \u0026\u0026 pod install\n```\n\nFor RN \u003c 0.60, use react-native link to add the library to your project:\n```sh\n$ react-native link react-native-fingerprint-scanner\n```\n\n### Manual Configuration\n\n#### iOS\n\n1. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [your project's name]`\n2. Go to `node_modules` ➜ `react-native-fingerprint-scanner` and add `ReactNativeFingerprintScanner.xcodeproj`\n3. To add the library \"libReactNativeFingerprintScanner.a\" to your project in XCode:\n    - In the project navigator, select your project.\n    - Click on the \"Build Phases\" tab.\n    - Under \"Link Binary With Libraries\", click the \"+\" button to add a new library.\n    - Search for \"libReactNativeFingerprintScanner.a\" and select it.\n    - Click \"Add\" to add the library to your project.\n4. Run your project (`Cmd+R`)\n\n#### Android\n\n1. Open up `android/app/src/main/java/[...]/MainApplication.java`\n  - Add `import com.hieuvp.fingerprint.ReactNativeFingerprintScannerPackage;` to the imports at the top of the file\n  - Add `new ReactNativeFingerprintScannerPackage()` to the list returned by the `getPackages()` method\n2. Append the following lines to `android/settings.gradle`:\n  \t```\n  \tinclude ':react-native-fingerprint-scanner'\n  \tproject(':react-native-fingerprint-scanner').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fingerprint-scanner/android')\n  \t```\n3. Insert the following lines inside the dependencies block in `android/app/build.gradle`:\n  \t```\n    implementation project(':react-native-fingerprint-scanner')\n  \t```\n\n### App Permissions\n\nAdd the following permissions to their respective files:\n\n#### Android\nIn your `AndroidManifest.xml`:\n\nAPI level 28+ (Uses Android native BiometricPrompt) ([Reference](https://developer.android.com/reference/android/Manifest.permission#USE_BIOMETRIC))\n```xml\n\u003cuses-permission android:name=\"android.permission.USE_BIOMETRIC\" /\u003e\n```\n\nAPI level 23-28 (Uses Android native FingerprintCompat) [Reference](https://developer.android.com/reference/android/Manifest.permission#USE_FINGERPRINT)) \n```xml\n\u003cuses-permission android:name=\"android.permission.USE_FINGERPRINT\" /\u003e\n```\n\n// DEPRECATED in 4.0.0\nAPI level \u003c23 (Uses device-specific native fingerprinting, if available - Samsung \u0026 MeiZu only) [Reference](https://developer.android.com/reference/android/Manifest.permission#USE_FINGERPRINT)) \n```xml\n\u003cuses-permission android:name=\"android.permission.USE_FINGERPRINT\" /\u003e\n```\n#### iOS\nIn your `Info.plist`:\n\n```xml\n\u003ckey\u003eNSFaceIDUsageDescription\u003c/key\u003e\n\u003cstring\u003e$(PRODUCT_NAME) requires FaceID access to allows you quick and secure access.\u003c/string\u003e\n```\n\n### Extra Configuration\n\n1. Make sure the following versions are all correct in `android/app/build.gradle`\n    ```\n    // API v29 enables FaceId\n    android {\n        compileSdkVersion 29\n        buildToolsVersion \"29.0.2\"\n    ...\n        defaultConfig {\n          targetSdkVersion 29\n    ```\n\n2. Add necessary rules to `android/app/proguard-rules.pro` if you are using proguard:\n    ```\n    # MeiZu Fingerprint\n\n    // DEPRECATED in 4.0.0\n    -keep class com.fingerprints.service.** { *; }\n    -dontwarn com.fingerprints.service.**\n\n    # Samsung Fingerprint\n\n    // DEPRECATED in 4.0.0\n    -keep class com.samsung.android.sdk.** { *; }\n    -dontwarn com.samsung.android.sdk.**\n    ```\n\n## Compatibility\n\n* For Gradle \u003c 3 you MUST install react-native-fingerprint-scanner at version \u003c= 2.5.0\n* For RN \u003e= 0.57 and/or Gradle \u003e= 3 you MUST install react-native-fingerprint-scanner at version \u003e= 2.6.0\n* For RN \u003e= 0.60 you MUST install react-native-fingerprint-scanner at version \u003e= 3.0.0\n* For Android native Face Unlock, MUST use \u003e= 4.0.0\n\n## Example\n\n[Example Source Code](https://github.com/hieuvp/react-native-fingerprint-scanner/tree/master/examples)\n\n**iOS Implementation**\n```javascript\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { AlertIOS } from 'react-native';\nimport FingerprintScanner from 'react-native-fingerprint-scanner';\n\nclass FingerprintPopup extends Component {\n\n  componentDidMount() {\n    FingerprintScanner\n      .authenticate({ description: 'Scan your fingerprint on the device scanner to continue' })\n      .then(() =\u003e {\n        this.props.handlePopupDismissed();\n        AlertIOS.alert('Authenticated successfully');\n      })\n      .catch((error) =\u003e {\n        this.props.handlePopupDismissed();\n        AlertIOS.alert(error.message);\n      });\n  }\n\n  render() {\n    return false;\n  }\n}\n\nFingerprintPopup.propTypes = {\n  handlePopupDismissed: PropTypes.func.isRequired,\n};\n\nexport default FingerprintPopup;\n```\n\n**Android Implementation**\n```javascript\n\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport {\n  Alert,\n  Image,\n  Text,\n  TouchableOpacity,\n  View,\n  ViewPropTypes,\n  Platform,\n} from 'react-native';\n\nimport FingerprintScanner from 'react-native-fingerprint-scanner';\nimport styles from './FingerprintPopup.component.styles';\nimport ShakingText from './ShakingText.component';\n\n\n// - this example component supports both the\n//   legacy device-specific (Android \u003c v23) and\n//   current (Android \u003e= 23) biometric APIs\n// - your lib and implementation may not need both\nclass BiometricPopup extends Component {\n  constructor(props) {\n    super(props);\n    this.state = {\n      errorMessageLegacy: undefined,\n      biometricLegacy: undefined\n    };\n\n    this.description = null;\n  }\n\n  componentDidMount() {\n    if (this.requiresLegacyAuthentication()) {\n      this.authLegacy();\n    } else {\n      this.authCurrent();\n    }\n  }\n\n  componentWillUnmount = () =\u003e {\n    FingerprintScanner.release();\n  }\n\n  requiresLegacyAuthentication() {\n    return Platform.Version \u003c 23;\n  }\n\n  authCurrent() {\n    FingerprintScanner\n      .authenticate({ title: 'Log in with Biometrics' })\n      .then(() =\u003e {\n        this.props.onAuthenticate();\n      });\n  }\n\n  authLegacy() {\n    FingerprintScanner\n      .authenticate({ onAttempt: this.handleAuthenticationAttemptedLegacy })\n      .then(() =\u003e {\n        this.props.handlePopupDismissedLegacy();\n        Alert.alert('Fingerprint Authentication', 'Authenticated successfully');\n      })\n      .catch((error) =\u003e {\n        this.setState({ errorMessageLegacy: error.message, biometricLegacy: error.biometric });\n        this.description.shake();\n      });\n  }\n\n  handleAuthenticationAttemptedLegacy = (error) =\u003e {\n    this.setState({ errorMessageLegacy: error.message });\n    this.description.shake();\n  };\n\n  renderLegacy() {\n    const { errorMessageLegacy, biometricLegacy } = this.state;\n    const { style, handlePopupDismissedLegacy } = this.props;\n\n    return (\n      \u003cView style={styles.container}\u003e\n        \u003cView style={[styles.contentContainer, style]}\u003e\n\n          \u003cImage\n            style={styles.logo}\n            source={require('./assets/finger_print.png')}\n          /\u003e\n\n          \u003cText style={styles.heading}\u003e\n            Biometric{'\\n'}Authentication\n          \u003c/Text\u003e\n          \u003cShakingText\n            ref={(instance) =\u003e { this.description = instance; }}\n            style={styles.description(!!errorMessageLegacy)}\u003e\n            {errorMessageLegacy || `Scan your ${biometricLegacy} on the\\ndevice scanner to continue`}\n          \u003c/ShakingText\u003e\n\n          \u003cTouchableOpacity\n            style={styles.buttonContainer}\n            onPress={handlePopupDismissedLegacy}\n          \u003e\n            \u003cText style={styles.buttonText}\u003e\n              BACK TO MAIN\n            \u003c/Text\u003e\n          \u003c/TouchableOpacity\u003e\n\n        \u003c/View\u003e\n      \u003c/View\u003e\n    );\n  }\n\n\n  render = () =\u003e {\n    if (this.requiresLegacyAuthentication()) {\n      return this.renderLegacy();\n    }\n\n    // current API UI provided by native BiometricPrompt\n    return null;\n  }\n}\n\nBiometricPopup.propTypes = {\n  onAuthenticate: PropTypes.func.isRequired,\n  handlePopupDismissedLegacy: PropTypes.func,\n  style: ViewPropTypes.style,\n};\n\nexport default BiometricPopup;\n```\n\n## API\n\n### `isSensorAvailable()`: (Android, iOS)\nChecks if Fingerprint Scanner is able to be used by now.\n\n- Returns a `Promise\u003cstring\u003e`\n- `biometryType: String` - The type of biometric authentication supported by the device.\n  - iOS: biometryType = 'Touch ID', 'Face ID'\n  - Android: biometryType = 'Biometrics'\n- `error: FingerprintScannerError { name, message, biometric }` - The name and message of failure and the biometric type in use.\n\n```javascript\ncomponentDidMount() {\n  FingerprintScanner\n    .isSensorAvailable()\n    .then(biometryType =\u003e this.setState({ biometryType }))\n    .catch(error =\u003e this.setState({ errorMessage: error.message }));\n}\n```\n\n### `authenticate({ description, fallbackEnabled })`: (iOS)\nStarts Fingerprint authentication on iOS.\n\n- Returns a `Promise`\n- `description: String` - the string to explain the request for user authentication.\n- `fallbackEnabled: Boolean` - default to `true`, whether to display fallback button (e.g. Enter Password).\n\n```javascript\ncomponentDidMount() {\n  FingerprintScanner\n    .authenticate({ description: 'Scan your fingerprint on the device scanner to continue' })\n    .then(() =\u003e {\n      this.props.handlePopupDismissed();\n      AlertIOS.alert('Authenticated successfully');\n    })\n    .catch((error) =\u003e {\n      this.props.handlePopupDismissed();\n      AlertIOS.alert(error.message);\n    });\n}\n```\n\n### `authenticate({ title=\"Log In\", subTitle, description, cancelButton=\"Cancel\", onAttempt=() =\u003e (null) })`: (Android)\nStarts Fingerprint authentication on Android.\n\n- Returns a `Promise`\n- `title: String` the title text to display in the native Android popup\n- `subTitle: String` the sub title text to display in the native Android popup\n- `description: String` the description text to display in the native Android popup\n- `cancelButton: String` the cancel button text to display in the native Android popup\n- `onAttempt: Function` - a callback function when users are trying to scan their fingerprint but failed.\n\n```javascript\ncomponentDidMount() {\n  if (requiresLegacyAuthentication()) {\n    authLegacy();\n  } else {\n    authCurrent();\n  }\n}\n\ncomponentWillUnmount = () =\u003e {\n  FingerprintScanner.release();\n}\n\nrequiresLegacyAuthentication() {\n  return Platform.Version \u003c 23;\n}\n\nauthCurrent() {\n  FingerprintScanner\n    .authenticate({ title: 'Log in with Biometrics' })\n    .then(() =\u003e {\n      this.props.onAuthenticate();\n    });\n}\n\nauthLegacy() {\n  FingerprintScanner\n    .authenticate({ onAttempt: this.handleAuthenticationAttemptedLegacy })\n    .then(() =\u003e {\n      this.props.handlePopupDismissedLegacy();\n      Alert.alert('Fingerprint Authentication', 'Authenticated successfully');\n    })\n    .catch((error) =\u003e {\n      this.setState({ errorMessageLegacy: error.message, biometricLegacy: error.biometric });\n      this.description.shake();\n    });\n}\n\nhandleAuthenticationAttemptedLegacy = (error) =\u003e {\n  this.setState({ errorMessageLegacy: error.message });\n  this.description.shake();\n};\n```\n\n### `release()`: (Android)\nStops fingerprint scanner listener, releases cache of internal state in native code, and cancels native prompt if visible.\n\n- Returns a `Void`\n\n```javascript\ncomponentWillUnmount() {\n  FingerprintScanner.release();\n}\n```\n\n### `Types of Biometrics`\n\n| Value | OS | Description|\n|---|---|---|\n| Touch ID | iOS | |\n| Face ID | iOS | |\n| Biometrics | Android | Refers to the biometric set as preferred on the device |\n\n### `Errors`\n\n| Name | Message |\n|---|---|\n| AuthenticationNotMatch | No match |\n| AuthenticationFailed | Authentication was not successful because the user failed to provide valid credentials |\n| AuthenticationTimeout | Authentication was not successful because the operation timed out |\n| AuthenticationProcessFailed | 'Sensor was unable to process the image. Please try again |\n| UserCancel | Authentication was canceled by the user - e.g. the user tapped Cancel in the dialog |\n| UserFallback | Authentication was canceled because the user tapped the fallback button (Enter Password) |\n| SystemCancel | Authentication was canceled by system - e.g. if another application came to foreground while the authentication dialog was up |\n| PasscodeNotSet | Authentication could not start because the passcode is not set on the device |\n| DeviceLocked | Authentication was not successful, the device currently in a lockout of 30 seconds |\n| DeviceLockedPermanent | Authentication was not successful, device must be unlocked via password |\n| DeviceOutOfMemory | Authentication could not proceed because there is not enough free memory on the device |\n| HardwareError | A hardware error occurred |\n| FingerprintScannerUnknownError | Could not authenticate for an unknown reason |\n| FingerprintScannerNotSupported | Device does not support Fingerprint Scanner |\n| FingerprintScannerNotEnrolled  | Authentication could not start because Fingerprint Scanner has no enrolled fingers |\n| FingerprintScannerNotAvailable | Authentication could not start because Fingerprint Scanner is not available on the device |\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhieuvp%2Freact-native-fingerprint-scanner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhieuvp%2Freact-native-fingerprint-scanner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhieuvp%2Freact-native-fingerprint-scanner/lists"}