Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const isBiometricEncryptionHardwareSupported = async () => {
if (Platform.OS === 'android') {
return await KeyStoreBridge.isFingerprintEncryptionHardwareSupported()
} else if (Platform.OS === 'ios') {
const supportedBiometrics = await Keychain.getSupportedBiometryType()
return (
supportedBiometrics === Keychain.BIOMETRY_TYPE.TOUCH_ID ||
supportedBiometrics === Keychain.BIOMETRY_TYPE.FACE_ID
)
}
throw new Error('Unsupported platform')
}
const getBiometryImage = (biometryType: string) => {
switch (biometryType) {
case Keychain.BIOMETRY_TYPE.TOUCH_ID:
case Keychain.BIOMETRY_TYPE.FINGERPRINT:
return touchIdImageSource;
case Keychain.BIOMETRY_TYPE.FACE_ID:
return faceIdImageSource;
default:
return '';
}
};
export const isBiometricEncryptionHardwareSupported = async () => {
if (Platform.OS === 'android') {
return await KeyStoreBridge.isFingerprintEncryptionHardwareSupported()
} else if (Platform.OS === 'ios') {
const supportedBiometrics = await Keychain.getSupportedBiometryType()
return (
supportedBiometrics === Keychain.BIOMETRY_TYPE.TOUCH_ID ||
supportedBiometrics === Keychain.BIOMETRY_TYPE.FACE_ID
)
}
throw new Error('Unsupported platform')
}