react-native-fingerprint-scanner
Version:
React Native Biometrics Scanner for Android and iOS
17 lines (13 loc) • 480 B
JavaScript
import { NativeModules } from 'react-native';
import createError from './createError';
const { ReactNativeFingerprintScanner } = NativeModules;
export default ({ description = ' ', fallbackEnabled = true }) => {
return new Promise((resolve, reject) => {
ReactNativeFingerprintScanner.authenticate(description, fallbackEnabled, error => {
if (error) {
return reject(createError(error.code, error.message))
}
return resolve(true);
});
});
}