Platform differences
Frameworks
| iOS | Android | |
|---|---|---|
| Framework | LocalAuthentication (LAContext) | android.hardware.biometrics BiometricManager and BiometricPrompt |
| Declaration | NSFaceIDUsageDescription (Face ID only) | USE_BIOMETRIC permission |
| Biometric types | fingerprint (Touch ID), facial_recognition (Face ID), optic_id (iOS 17+) | fingerprint, facial_recognition, iris |
| Biometric classes | Always strong | Class 2 (weak) or Class 3 (strong) |
| Lockout query | Live from LAContext | The latest prompt in this process |
| Prompt title | System title; promptMessage is the reason | promptMessage, or the app name |
Android versions
| Android | Biometrics | Device credential fallback |
|---|---|---|
| 11+ | BiometricPrompt with setAllowedAuthenticators, honouring the class. | In the same prompt. |
| 10 | BiometricPrompt; biometricsSecurityLevel is not enforced. | In the same prompt, or the keyguard screen without biometrics. |
| 8 and 9 | Not available: isEnrolled is false, authenticate without fallback resolves with not_available. | The keyguard's confirm-credential screen. |
On the keyguard screen, promptMessage is the title and promptDescription the description. Leaving the screen without confirming resolves with user_cancel. cancelAuthenticate cannot close it; the promise resolves with app_cancel at once and the screen's result is ignored.
Options by platform
| Option | iOS | Android |
|---|---|---|
promptMessage | The reason under the title. Defaults to "Authenticate". | The title. Defaults to the app name. |
promptSubtitle | Ignored. | The subtitle. |
promptDescription | Ignored. | The description. |
cancelLabel | The cancel button. | The cancel button when disableDeviceFallback is set. Defaults to "Cancel". |
disableDeviceFallback | Uses deviceOwnerAuthenticationWithBiometrics instead of deviceOwnerAuthentication. | Allows only biometrics instead of biometrics or DEVICE_CREDENTIAL. |
requireConfirmation | Ignored. | Whether a passive match, such as face unlock, needs a tap. Defaults to true. |
biometricsSecurityLevel | Ignored. iOS biometrics are always strong. | weak (default) allows Class 2 biometrics, strong only Class 3. |
fallbackLabel | The fallback button after a failed attempt. '' hides it, and it is hidden by default with disableDeviceFallback. | Ignored. |
Platform-only error codes
| Code | Platform |
|---|---|
user_fallback, invalid_context, not_interactive | iOS |
timeout, no_space, unable_to_process | Android |
See Error codes for the native source of each.