1 | import invariant from 'invariant';
|
2 | import { NativeModules, Platform } from 'react-native';
|
3 | const { ExponentFingerprint } = NativeModules;
|
4 | export function hasHardwareAsync() {
|
5 | return ExponentFingerprint.hasHardwareAsync();
|
6 | }
|
7 | export function isEnrolledAsync() {
|
8 | return ExponentFingerprint.isEnrolledAsync();
|
9 | }
|
10 | export 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 | }
|
19 | export function cancelAuthenticate() {
|
20 | ExponentFingerprint.cancelAuthenticate();
|
21 | }
|
22 |
|
\ | No newline at end of file |