Skip to content

tomhall/react-native-biometric-authentication

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
  }) 

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published