expo-local-authentication
Provides an API for FaceID and TouchID (iOS) or the Fingerprint API (Android) to authenticate the user with a face or fingerprint scan.
API documentation
Installation
This package is pre-installed in managed Expo projects. You may skip the rest of the installation guide if this applies to you.
For bare React Native projects, you must ensure that you have installed and configured the @unimodules/core
package before continuing.
Add the package to your npm dependencies
npm install expo-local-authentication
Configure for iOS
Add the dependency to your Podfile
and then run pod install
.
pod 'EXLocalAuthentication', path: '../node_modules/expo-local-authentication/ios'
Configure for Android
- Append the following lines to
android/settings.gradle
:
include ':expo-local-authentication'
project(':expo-local-authentication').projectDir = new File(rootProject.projectDir, '../node_modules/expo-local-authentication/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:
api project(':expo-local-authentication')
- In
MainApplication.java
, import the package and add it to the ReactModuleRegistryProvider
list:
import expo.modules.localauthentication.LocalAuthenticationPackage;
private final ReactModuleRegistryProvider mModuleRegistryProvider = new ReactModuleRegistryProvider(Arrays.<Package>asList(
new LocalAuthenticationPackage()
), Arrays.<SingletonModule>asList());
Contributing
Contributions are very welcome! Please refer to guidelines described in the contributing guide.