← Plugins / Biometric Auth
This community plugin ("All-In-One") gives you a single, cross-platform API for biometric authentication — Touch ID and Face ID on iOS, and the BiometricPrompt fingerprint/face dialog on Android. You check availability, then show the system prompt and react to the result.
cordova plugin add cordova-plugin-fingerprint-aio
On iOS you can set the Face ID usage string with the FACEID_USAGE_DESCRIPTION install variable.
The plugin is exposed as Fingerprint after deviceready:
| Method | Description |
|---|---|
Fingerprint.isAvailable(success, error, options) | Reports whether biometrics are set up; success receives the type, e.g. "finger", "face" or "biometric". |
Fingerprint.show(options, success, error) | Displays the native authentication prompt and calls success when the user is verified. |
Fingerprint.registerBiometricSecret(options, success, error) | Stores a secret protected behind biometric authentication. |
Fingerprint.loadBiometricSecret(options, success, error) | Retrieves a stored secret after a successful authentication. |
| Key | Type | Description |
|---|---|---|
title | String | Title shown on the prompt. |
subtitle | String | Secondary line under the title (Android). |
description | String | Longer descriptive text. |
fallbackButtonTitle | String | Label for the fallback (e.g. passcode) button. |
disableBackup | Boolean | Hide the device-credential fallback and require biometrics only. |
Check availability, then prompt the user to unlock:
function unlock() {
Fingerprint.isAvailable(
function (type) {
Fingerprint.show(
{ title: "Unlock DedrisApp", disableBackup: false },
function () {
console.log("Authenticated with " + type);
},
function (err) {
console.error("Auth failed: " + err.message);
}
);
},
function (err) {
console.log("Biometrics unavailable: " + err.message);
}
);
}
isAvailable first — not every device has biometrics enrolled.registerBiometricSecret / loadBiometricSecret for sensitive values.