{"_id":"@altergo/react-native-biometrics","_rev":"2-582031f22e4198f2f70398f841e34a44","name":"@altergo/react-native-biometrics","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@altergo/react-native-biometrics","version":"1.0.0","description":"React Native biometrics support for Android and iOS","main":"index.js","keywords":["react-native","biometrics","fingerprint","touchid","faceid"],"repository":{"type":"git","url":"git@gitlab.com:altergo/rn/packages/react-native-biometrics.git"},"author":{"name":"Mikhail Smirnov","url":"https://gitlab.com/smrnvmkhl"},"license":"MIT","peerDependencies":{"react-native":">=0.57.0"},"gitHead":"6d5f13db7ebb6237a281e12d751fba908faf2bbc","_id":"@altergo/react-native-biometrics@1.0.0","_nodeVersion":"11.14.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-SFy72oZadVWtiZYyVZZDiYwl0KP6YT9WkdijeAPKsTlxQ0IZvfB13M3m7DfI0WVz3DHkNK9cUMMY2MM8N6urdg==","shasum":"12aff8e3f5f6a8b98e82cf62efafaf1fb9588a25","tarball":"https://registry.npmjs.org/@altergo/react-native-biometrics/-/react-native-biometrics-1.0.0.tgz","fileCount":28,"unpackedSize":36091,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc/CGqCRA9TVsSAnZWagAA8YQP/1YsHoH1CfAAslhFbP+H\nBITMXkdGk7fmUhFm0SK1MpcEfl+Yw4STvblFCKCU3btIlpbCsJXCH4zcsrC4\nMj7JMGoIGR1TFPbn3PzOg7quUm3MDHVUxNSW17BNeEcDP+VvMi5giI/oe6xJ\nYPuc6FUcktp8lPNy8s5xRAYAtKs2Z7lsJHjX+z10OwWd7c/o7ZvaYxvI6V2h\nXsAMcQPmPa0ItlXf5uGMbyHppat+5KW2Suu85xCY0SgwtGHT6ka07RjjcvVI\nVf+JZKWxbZbi9Egt+DbKQszgU/CnuXSQkLTN+hjL3WUVtfPVmeKSImS5+YYn\nkWnPkBPC9FLj96lT81t4B/nbNGDPnpFfREYxqEBReQhzNml1W0DGLsCJuUb3\nCFQElanIFZudILkC2dy6h0JFY9NNub202BDOffE/JaQAQPXaLFnMAGUAr4nO\nkQw/L2G40SlPzoQpxP2Zneh0f3F04cTNzk2I2LSY3crDrMUN3IIfS0QSV95X\ntefttEGUu9QQtYNxHv7HkCj7UkiWK38px0/ow0SruHQ7arIPv97OB6XHe2oW\npm3ICtpk1iyehZ8TvsEg6GjQRsBBzApzbcqjRFhcQjQALCbpA46f104L2mVs\nwIHJ5RUpa4gHMeO0xrQx4Y9iAdY1qwbZ8APg7vLLpmj0A40DxRX86f/bRxct\n64IF\r\n=X7hA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA49ruGTmZcPx+K45SNIgJ5VlXvY43Pt3seoAQJ2JFwQAiBy2aEMkKZ6nbIA3/Uu+9WPokuWWMx24q1PFxQtNlWXqQ=="}]},"maintainers":[{"name":"smrnvmkhl","email":"smrnvmkhl@gmail.com"}],"_npmUser":{"name":"smrnvmkhl","email":"smrnvmkhl@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-biometrics_1.0.0_1560027561019_0.47901171637016304"},"_hasShrinkwrap":false}},"time":{"created":"2019-06-08T20:59:20.813Z","1.0.0":"2019-06-08T20:59:21.148Z","modified":"2022-04-04T13:39:50.910Z"},"maintainers":[],"description":"React Native biometrics support for Android and iOS","keywords":["react-native","biometrics","fingerprint","touchid","faceid"],"repository":{"type":"git","url":"git@gitlab.com:altergo/rn/packages/react-native-biometrics.git"},"author":{"name":"Mikhail Smirnov","url":"https://gitlab.com/smrnvmkhl"},"license":"MIT","readme":"# React Native Biometrics\n\n[![React Native Version](https://img.shields.io/badge/react--native-0.57.0-green.svg?style=flat-square)](https://github.com/react-native-community/react-native-releases/blob/master/CHANGELOG.md#057)\n\nReact Native Biometrics is a [React Native](https://github.com/facebook/react-native) library for authenticating users with biometrics. Inspired by [react-native-fingerprint-scanner](https://github.com/hieuvp/react-native-fingerprint-scanner).\n\n**iOS**\n> The usage of the `TouchID` is based on a framework, named `Local Authentication`\n>\n> It provides a `Default View` that prompts the user to place a finger to the `iPhone`’s button for scanning\n\n**Android**\n> Using 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>\n> `Samsung` and `Meizu`'s `Fingerprint SDK` supports most devices which system versions less than `Android 6.0`\n\n## Table of Contents\n\n- [Installation](#installation)\n- [API](#api)\n- [Constants](#constants)\n\n# Installation\n\n```console\n$ yarn add react-native-biometrics\n```\n\n### Automatic Configuration\n\n```console\n$ npx react-native link react-native-biometrics\n```\n\n### Manual Configuration\n\n**iOS**\n1. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [your project's name]`\n2. Go to `node_modules` ➜ `react-native-biometrics` and add `ReactNativeBiometrics.xcodeproj`\n3. In XCode, in the project navigator, select your project. Add `libReactNativeBiometrics.a` to your project's `Build Phases` ➜ `Link Binary With Libraries`\n4. Run your project\n\n**Android**\n- Open up `android/app/src/main/java/.../MainActivity.java`\n- Add to the imports at the top of the file\n```java\nimport com.smrnvmkhl.biometrics.ReactNativeBiometricsPackage;\n```\n- Add `new ReactNativeBiometricsPackage()` to the list returned by the `getPackages()` method\n```java\n@Override\nprotected List<ReactPackage> getPackages() {\n  return Arrays.<ReactPackage>asList(\n      new MainReactPackage(),\n      ...\n      new ReactNativeBiometricsPackage()\n  );\n}\n```\n- Append the following lines to `android/settings.gradle`:\n```gradle\ninclude ':react-native-biometrics'\nproject(':react-native-biometrics').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-biometrics/android')\n```\n- Insert the following lines inside the dependencies block in `android/app/build.gradle`\n```gradle\ncompile project(':react-native-biometrics')\n```\n- Add rules to proguard rules file (default: `android/app/proguard-rules.pro`)\n\n### Permissions\n\nAdd the following permissions to their respective files:\n\n**`AndroidManifest.xml`**\n```xml\n<uses-permission android:name=\"android.permission.USE_BIOMETRY\" />\n```\n\n**`Info.plist`**\n```plist\n<key>NSFaceIDUsageDescription</key>\n<string>$(PRODUCT_NAME) requires FaceID access to allows you quick and secure access</string>\n```\n\n# API\n\n| Name | Description | OS |\n|-|-|-|\n| [authenticate](#authenticate)  | Starts biometrics authentication | Both |\n| [getStatus](#getStatus) | Get biometrics status code | Both |\n| [release](#release) | Stops biometrics listener | Android |\n\n### authenticate\n```javascript\nauthenticate({\n  onNotMatch: Function(code), // Callback calls when firngerprint not matched\n  description: String, // Purpose of request for user authentication\n  fallback: String, // Text of fallback button\n  reuse: Number, // Number of seconds after unlock by biometrics\n}): Promise<String>\n```\n\n### getStatus\n```javascript\ngetStatus(): Promise<String>\n```\n\n### release\n```javascript\nrelease(): void\n```\n\n# Codes\n\n| Code | Description | OS |\n|-|-|-|\n| **`fingerprint`** | TouchID on iOS and Fingerprint on Android | **Both** |\n| **`face`** | FaceID on iOS | iOS |\n| **`success`** | Success authenticate | **Both** |\n| **`failed`** | The user failed to provide valid credentials | **Both** |\n| **`notSupported`** | Device does not support biometrics | **Both** |\n| **`notAvailable`** | Biometrics is not available on the device | **Both** |\n| **`notEnrolled`** | The user has no enrolled biometric identities | **Both** |\n| **`notMatch`** | No match | Android |\n| **`deviceLocked`** | Authentication was not successful, the device currently in a lockout | Android |\n| **`userCancel`** | The user tapped the cancel button in the authentication dialog | iOS |\n| **`fallback`** | The user tapped the fallback button in the authentication dialog, but no fallback is available for the authentication policy | iOS |\n| **`systemCancel`** | The system canceled authentication | iOS |\n| **`passcodeNotSet`** | A passcode isn’t set on the device | iOS |\n| **`unknown`** | Could not authenticate for an unknown reason | iOS |\n","readmeFilename":"README.md"}