UNPKG

862 BJavaScriptView Raw
1import invariant from 'invariant';
2import { NativeModules, Platform } from 'react-native';
3const { ExponentFingerprint } = NativeModules;
4export function hasHardwareAsync() {
5 return ExponentFingerprint.hasHardwareAsync();
6}
7export function isEnrolledAsync() {
8 return ExponentFingerprint.isEnrolledAsync();
9}
10export function authenticateAsync(promptMessageIOS = 'Authenticate') {
11 if (Platform.OS === 'ios') {
12 invariant(typeof promptMessageIOS === 'string' && promptMessageIOS.length, 'Fingerprint.authenticateAsync must be called with a non-empty string on iOS');
13 return ExponentFingerprint.authenticateAsync(promptMessageIOS);
14 }
15 else {
16 return ExponentFingerprint.authenticateAsync();
17 }
18}
19export function cancelAuthenticate() {
20 ExponentFingerprint.cancelAuthenticate();
21}
22//# sourceMappingURL=Fingerprint.js.map
\No newline at end of file