Utilisez @capgo/capacitor-native-biometric
Ce plugin donne accès aux APIs de biométriques natives pour Android et iOS.
Installer
bun add @capgo/capacitor-native-biometric
bunx cap sync
Ce que ce plugin expose
isAvailable- Vérifie si le matériel d'authentification biométrique est disponible.verifyIdentity- Demande à l'utilisateur de s'authentifier avec des biométriques.getCredentials- Gets the stored credentials for a given server.setCredentials- Stores the given credentials for a given server.
Exemple d'utilisation
isAvailable
Vérifie si le matériel d'authentification biométrique est disponible.
import { NativeBiometric } from '@capgo/capacitor-native-biometric';
await NativeBiometric.isAvailable();
verifyIdentity
Invite l'utilisateur à s'authentifier avec des biométriques.
import { NativeBiometric } from '@capgo/capacitor-native-biometric';
await NativeBiometric.verifyIdentity();
getCredentials
Gets the stored credentials for a given server.
import { NativeBiometric } from '@capgo/capacitor-native-biometric';
await NativeBiometric.getCredentials({} as GetCredentialOptions);
setCredentials
Stores the given credentials for a given server.
import { NativeBiometric } from '@capgo/capacitor-native-biometric';
await NativeBiometric.setCredentials({} as SetCredentialOptions);
Référence complète
- GitHub: https://github.com/Capgo/capacitor-biométrique-natif/
- Documentation : /docs/plugins/native-biometric/
Continuez à partir de @capgo/capacitor-native-biometrique
Si vous utilisez En utilisant @capgo/capacitor-native-biometric pour planifier l'authentification et les flux de compte, connectez-l’avec @capgo/capacitor-biométrique pour les détails d'implémentation dans @capgo/capacitor-native-biometric, Prise en main pour les détails d'implémentation dans Prise en main, @capgo/capacitor-connexion-social pour les détails d'implémentation dans @capgo/capacitor-social-login, @capgo/capacitor-passkey pour les détails d'implémentation dans @capgo/capacitor-passkey, et Authentification à deux facteurs pour les détails d'implémentation dans Authentification à deux facteurs.