Class: Device
Methods
getAvailableHardware
▸ getAvailableHardware(): Promise<SupportedBiometricType[]>
Gets the types of biometrics the device supports.
Returns
Promise<SupportedBiometricType[]>
Usage
_10const hardware = await Device.getAvailableHardware();_10hardware.forEach((biometricType) => console.log("Type: " + biometricType));
getBiometricStrengthLevel
▸ getBiometricStrengthLevel(): Promise<BiometricSecurityStrength>
Checks the device biometric strength level.
On iOS this will always return 'strong'.
Returns
Promise<BiometricSecurityStrength>
Usage
_10const biometricStrength = await Device.getBiometricStrengthLevel();
hasSecureHardware
▸ hasSecureHardware(): Promise<boolean>
Check if the device has a secure hardware enclave.
Returns
Promise<boolean>
Usage
_10const hasSecureHardware = await Device.hasSecureHardware();_10if (!hasSecureHardware) {_10 // this device doesn't have secure hardware_10}
isBiometricsAllowed
▸ isBiometricsAllowed(): Promise<BiometricPermissionState>
Returns the current state of biometric permissions.
On Android and iOS devices with TouchID, this always returns granted.
Returns
Promise<BiometricPermissionState>
Usage
_10const permissions = await Device.isBiometricsAllowed();_10if (permissions === BiometricPermissionState.Denied) {_10 // user must enable FaceID for the application..._10}
isBiometricsEnabled
▸ isBiometricsEnabled(): Promise<boolean>
Check whether or not biometrics is supported by the device and has been configured by the current user of the device.
Returns
Promise<boolean>
Usage
_10const biometricsEnabled = await Device.isBiometricsEnabled();_10if (!biometricsEnabled) {_10 // biometrics not enabled on this device..._10}
isBiometricsSupported
▸ isBiometricsSupported(): Promise<boolean>
Check whether or not biometrics is supported by the device.
Returns
Promise<boolean>
Usage
_10const biometricsSupported = await Device.isBiometricsSupported();_10if (biometricsSupported) {_10 // biometrics is supported on this device..._10}
isLockedOutOfBiometrics
▸ isLockedOutOfBiometrics(): Promise<boolean>
Check whether biometrics are locked out on the device.
On Android, the locked out state will only known after an attempted biometric unlock.
Returns
Promise<boolean>
Usage
_10const isLockedOut = await Device.isLockedOutOfBiometrics();_10if (isLockedOut) {_10 // device is locked out ..._10}
isSystemPasscodeSet
▸ isSystemPasscodeSet(): Promise<boolean>
Check whether the device OS-level passcode has been set.
Returns
Promise<boolean>
Usage
_10const hasSystemPasscode = await Device.isSystemPasscodeSet();_10if (hasSystemPasscode) {_10 // device has a system passcode_10}
showBiometricPrompt
▸ showBiometricPrompt(config): Promise<void>
Show a biometric prompt.
Parameters
| Name | Type |
|---|---|
config | PromptConfig |
Returns
Promise<void>
Usage
_10try {_10 const promptConfig = {...};_10 await Device.showBiometricPrompt(promptConfig);_10 // biometric prompt succeeded successfully_10} catch (err) {_10 // handle error_10}