PHP code example of projectmata / mobile-biometrics
1. Go to this page and download the library: Download projectmata/mobile-biometrics library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
projectmata / mobile-biometrics example snippets
use Projectmata\MobileBiometrics\Facades\Biometrics;
// Is biometric hardware available & enrolled?
$status = Biometrics::isAvailable();
// What authenticators does the device expose?
$types = Biometrics::getTypes();
// Prompt the user to authenticate
$result = Biometrics::authenticate(
reason: 'Confirm your identity to continue',
title: 'Unlock',
subtitle: 'Use your fingerprint or face',
negativeButton: 'Cancel',
);
if ($result['success'] ?? false) {
// authenticated
}
bash
php artisan native:run android
# or
php artisan native:run ios