Constants
BiometryType
A biometric modality that can unlock a key, as getBiometryTypes reports it: Face ID, Touch ID and Optic ID on iOS; fingerprint, face and iris on Android. A constant object and a type of the same name.
Import
import { BiometryType } from '@apexnative/keychain';
Usage
import { BiometryType, getBiometryTypes } from '@apexnative/keychain';
const hasFace = (await getBiometryTypes()).includes(BiometryType.FaceID);
Signature
const BiometryType: {
readonly FaceID: 'faceID';
readonly TouchID: 'touchID';
readonly OpticID: 'opticID';
readonly Fingerprint: 'fingerprint';
readonly Face: 'face';
readonly Iris: 'iris';
};
type BiometryType = (typeof BiometryType)[keyof typeof BiometryType];
Type
'faceID' | 'touchID' | 'opticID' | 'fingerprint' | 'face' | 'iris'PlatformsiOSAndroidValues
| Constant | String | Platform | What |
|---|---|---|---|
FaceID | 'faceID' | iOS | Face ID |
TouchID | 'touchID' | iOS | Touch ID |
OpticID | 'opticID' | iOS | Optic ID, on Apple Vision Pro |
Fingerprint | 'fingerprint' | Android | A fingerprint sensor |
Face | 'face' | Android | Face recognition |
Iris | 'iris' | Android | Iris recognition |
An iOS device reports one value at most; an Android device may report several. BiometryType.FaceID is the string 'faceID', so a comparison with either works.