expo-local-authentication
allows you to use FaceID and TouchID (iOS) or the Biometric Prompt (Android) to authenticate the user with a face or fingerprint scan.Android Device | Android Emulator | iOS Device | iOS Simulator | Web |
---|---|---|---|---|
Pending |
expo install expo-local-authentication
If you're installing this in a bare React Native app, you should also follow these additional installation instructions.
USE_BIOMETRIC
and USE_FINGERPRINT
permissions are automatically added.import * as LocalAuthentication from 'expo-local-authentication';
LocalAuthentication.AuthenticationType.{FINGERPRINT, FACIAL_RECOGNITION, IRIS}
. A value of 1
indicates fingerprint support, 2
indicates facial recognition support, and 3
indicates iris recognition support (Android-only). Devices can support multiple authentication methods- i.e. [1,2]
means the device supports both fingerprint and facial recognition. If none are supported, this method returns an empty array.Note: Apple requires apps which use FaceID to provide a description of why they use this API. If you try to use FaceID on an iPhone with FaceID without providinginfoPlist.NSFaceIDUsageDescription
inapp.json
, the module will authenticate using device passcode. For more information about usage descriptions on iOS, see Deploying to App Stores.
Cancel
label shown.Use Passcode
label shown after several failed authentication attempts. Setting this option to an empty string disables this button from showing in the prompt. (iOS only)false
.success
, a boolean indicating whether or not the authentication was successful, and error
containing the error code in the case where authentication fails.