The Biometrics API allows you to authenticate users using native biometric authentication methods such as fingerprint, Face ID, Touch ID, or other device-specific biometric sensors.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/NativePHP/mobile-air/llms.txt
Use this file to discover all available pages before exploring further.
Usage
Authenticate users with a simple prompt:Biometric\Completed event.
Methods
prompt()
Initiates a biometric authentication prompt on the device.
Returns: PendingBiometric - A fluent interface for configuring the authentication request
Example:
Fluent API
ThePendingBiometric class provides a fluent interface for configuring biometric authentication:
id(string $id)
Set a unique identifier for the authentication request to correlate with events.
Parameters:
$id(string) - Unique identifier for this authentication request
PendingBiometric
Example:
event(string $eventClass)
Dispatch a custom event class instead of the default Biometric\Completed event.
Parameters:
$eventClass(string) - Fully qualified event class name
PendingBiometric
Example:
remember()
Store the authentication request ID in the session for later retrieval.
Returns: PendingBiometric
Example:
prompt()
Explicitly start the biometric authentication (called automatically if not invoked).
Returns: bool - True if the prompt was initiated successfully
Example:
Events
Native\Mobile\Events\Biometric\Completed
Dispatched when biometric authentication completes.
Properties:
success(bool) - Whether authentication was successfulid(string|null) - The unique identifier if one was set
Examples
Basic Authentication
Tracking Multiple Authentication Requests
Custom Event Handler
Platform Notes
iOS
- Uses Face ID on devices with TrueDepth camera
- Uses Touch ID on devices with fingerprint sensor
- Requires
NSFaceIDUsageDescriptionin Info.plist - System handles the biometric prompt UI automatically
Android
- Uses BiometricPrompt API (Android 9+)
- Supports fingerprint, face, and iris authentication
- Falls back to device PIN/pattern if biometrics unavailable
- Requires
USE_BIOMETRICpermission in AndroidManifest.xml
Biometric authentication requires that the user has enrolled biometric data on their device. If no biometrics are enrolled, the authentication will fail immediately.