Biometric Unlock

Biometric unlock asks for Face ID or a fingerprint before the next step: showing a ticket, confirming a payment, opening something private. It does not sign anyone in; it confirms that the person holding the phone is the one who unlocked it.

Adding it

Add Biometric unlock to a button and fill in:

ReasonThe sentence the system prompt shows, such as Confirm it is you to see your ticket.
On successWhat runs once the person is confirmed.
On deniedWhat runs when it cannot be used: unavailable or blocked, below.

Only Face ID or a fingerprint counts: the phone's passcode is not offered. If the person cancels the prompt, or it gives up after failed tries, nothing runs.

When it cannot be used

Inside On denied, the reason reads one of two words:

unavailableNo Face ID or fingerprint set up, or none on the device. On an iPhone, Face ID turned off for this app reads the same: iOS reports it as no Face ID at all.
blockedLocked out after too many failed tries. The person unlocks the phone with its passcode, then tries again.

Without On denied, the app says so itself: “Face ID or fingerprint isn't set up for this app.” with an Open settings button, or “Too many tries. Unlock your phone with its passcode, then try again.” Any other failure says “Couldn't confirm it's you.”

Face ID's words

iOS shows your Face ID message from App, Permission messages the first time the prompt appears. App Store review rejects an app that uses Face ID without it.

What each export uses

Flutter. local_auth. On Android it needs your MainActivity to extend FlutterFragmentActivity: the export writes koolbase/biometrics/MainActivity.kt.txt to merge once.

Expo. expo-local-authentication.

Web. Not available: a browser has no prompt that confirms the person holding the device, so a web design with Biometric unlock does not export. Passkeys, a way to sign in, are separate.

Trying it

Preview cannot use Face ID or a fingerprint, so it says the prompt runs on a device. On a phone, try it once with Face ID or a fingerprint set up, once with none, and once after turning Face ID off for the app in Settings.