React Native · APIs and utilities
Biometrics
Biometric authentication.
6 exports
Import
Biometrics
moduleBiometric authentication.
| Name | Type | Description |
|---|---|---|
getStatus | (options?: { strong?: boolean; }) => Promise<BiometricStatus> | Hardware, enrollment and type. strong: on Android only Class 3 biometry counts. |
authenticate | (options?: AuthenticateOptions) => Promise<AuthenticateResult> | Opens the system authentication dialog. The result is { success }; on failure error gives the reason (cancelled, lockout, not-enrolled…). |
cancel | () => Promise<void> | Closes the open authentication dialog (returns cancelled). |
BiometricType
typeBiometry type. optic: Apple Vision Pro Optic ID.
BiometricStatus
interfaceThe device's biometry status.
| Name | Type | Description |
|---|---|---|
hardware | boolean | Is there biometric hardware. |
enrolled | boolean | Is a fingerprint/face enrolled (can authentication be done). |
type | BiometricType | Type. On Android, if there are several, fingerprint comes first. |
deviceCredential | boolean | Does the device have a screen lock (PIN, pattern, password). |
AuthenticateOptions
interfaceOptions for Biometrics.authenticate.
| Name | Type | Default | Description |
|---|---|---|---|
prompt? | string | "Kimliğini doğrula" | Why authentication is requested (iOS reason, Android title). |
subtitle? | string | Android: subtitle. | |
description? | string | Android: description. | |
cancelLabel? | string | Cancel button. | |
fallbackLabel? | string | iOS: button shown when biometry fails (returns the fallback result). Hidden if not given and allowDeviceCredential is off. | |
allowDeviceCredential? | boolean | false | Also accept the screen lock (PIN/password) instead of biometry (Android 10+). |
strong? | boolean | false | Android: strong (Class 3) biometry only. |
requireConfirmation? | boolean | false | Android: require an extra confirm button for face recognition. |
Authentication error.
Authentication result. Errors also resolve (never reject).
| Name | Type | Description |
|---|---|---|
success | true | false | Authenticated. |
error | AuthenticateError | Error code.({ /** Not authenticated. */ success: false; /** Error code. */ error: AuthenticateError; /** Error message from the system. */ message: string; }) |
message | string | Error message from the system.({ /** Not authenticated. */ success: false; /** Error code. */ error: AuthenticateError; /** Error message from the system. */ message: string; }) |