Skip to content
React Native Fingerprint Authentication for iOS and Android
Java Objective-C JavaScript Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
android
example
ios
.eslintrc.json
.gitignore
README.md
index.js
package-lock.json
package.json

README.md

React Native Biometric Authentication

For iOS and Android

This library enables you to quickly add biometric authentication (fingerprint, Touch ID and Face ID) to your React Native app.

Getting started

Import the library

import BiometricAuthentication from 'react-native-biometric-authentication';

Check the device has biometric authentication

The library will return true or false.

var hasBiometricAuthentication = await BiometricAuthentication.hasBiometricAuthentication()

or

BiometricAuthentication.hasBiometricAuthentication()
  .then((hasBiometricAuthentication) => {
    // do something with hasBiometricAuthentication
  }) 

Get the type of biometric authentication

The library will return:

  • Fingerprint (Android)
  • Touch ID (iOS)
  • Face ID (iOS)
  • Unknown**

** Unknown will be shown if the device does not have biometric authentication, or, when the use of biometric authentication has been disallowed by the user.

var biometricType = await BiometricAuthentication.biometricType()

or

BiometricAuthentication.biometricType()
  .then((biometricType => {
    // do something with biometricType
  }) 

Authenticate

This will prompt the user to authenticate using the devices supported biometric authentication method.

var isAuthenticated = await BiometricAuthentication.authenticate("Authenticate to continue...")

or

BiometricAuthentication.authenticate("Authenticate to continue...")
  .then((authenticated => {
    // do something with authenticated
  }) 
You can’t perform that action at this time.