How to use the react-native-fingerprint-scanner.authenticate function in react-native-fingerprint-scanner

To help you get started, we’ve selected a few react-native-fingerprint-scanner examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github flow-typed / flow-typed / definitions / npm / react-native-fingerprint-scanner_v2.x.x / flow_v0.69.0- / test_react-native-fingerprint-scanner.js View on Github external
it("passes when used properly", () => {
      FingerprintScanner.authenticate({
        description: "Any string",
        fallbackEnabled: true
      });

      FingerprintScanner.authenticate({
        description: "Any string"
      });

      FingerprintScanner.authenticate({
        fallbackEnabled: true
      });
    });
github daper / nextcloud-passwords-app / src / Lock.js View on Github external
async componentDidMount () {
    if (!this.props.isLocked) {
      this.props.history.push('/dashboard')
      return
    }

    try {
      let isAvailable = await FingerprintScanner.isSensorAvailable()
      if (!isAvailable) {
        this.setState({ sensorAvail: isAvailable })
      } else {
        await FingerprintScanner.authenticate({ onAttempt: this.setError })
        await this.setState({ isError: false })
        
        setTimeout(this.goBack, 400)
      }
    } catch (err) {
      this.setError(err)
    }
  }
github LiskHQ / lisk-mobile / src / utilities / passphrase.js View on Github external
errorCallback = err => err,
  description,
  androidError,
}) => {
  const authConfig =
    Platform.OS === 'ios'
      ? {
          description:
            description ||
            'Scan your fingerprint on the device scanner to sign in',
        }
      : { onAttempt: androidError };
  try {
    await FingerprintScanner.isSensorAvailable();
    try {
      await FingerprintScanner.authenticate(authConfig);
      successCallback();
    } catch (error) {
      errorCallback(error);
    }
  } catch (error) {
    errorCallback(error);
  }
};
github hieuvp / react-native-fingerprint-scanner / examples / src / FingerprintPopup.component.ios.js View on Github external
componentDidMount() {
    FingerprintScanner
      .authenticate({ description: 'Scan your fingerprint on the device scanner to continue' })
      .then(() => {
        this.props.handlePopupDismissed();
        AlertIOS.alert('Authenticated successfully');
      })
      .catch((error) => {
        this.props.handlePopupDismissed();
        AlertIOS.alert(error.message);
      });
  }
github iotaledger / trinity-wallet / src / mobile / containers / fingerprintDisable.js View on Github external
activateFingerPrintScanner() {
        const { t } = this.props;
        FingerprintScanner.authenticate({
            onAttempt: this.handleAuthenticationAttempted,
            description: t('instructions'),
        })
            .then(() => {
                //this.props.generateAlert('success', 'Fingerprint authentication', 'Authenticated successfully');
                this.setState({
                    currentFingerStatusInfo: 'Authenticated successfully',
                    currentFingerStatus: 1,
                });
            })
            .catch(error => {
                this.setState({ errorMessage: error.message });
            });
    }
    handleAuthenticationAttempted = () => {
github hieuvp / react-native-fingerprint-scanner / examples / src / FingerprintPopup.component.android.js View on Github external
componentDidMount() {
    FingerprintScanner
      .authenticate({ onAttempt: this.handleAuthenticationAttempted })
      .then(() => {
        this.props.handlePopupDismissed();
        Alert.alert('Fingerprint Authentication', 'Authenticated successfully');
      })
      .catch((error) => {
        this.setState({ errorMessage: error.message });
        this.description.shake();
      });
  }
github iotaledger / trinity-wallet / src / mobile / src / ui / views / wallet / Send.js View on Github external
activateFingerprintScanner() {
        const { t } = this.props;
        if (isAndroid) {
            this.props.toggleModalActivity();
            return timer.setTimeout('displayFingerPrintModal', () => this.showModal('fingerprint'), 300);
        }
        FingerprintScanner.authenticate({ description: t('fingerprintOnSend') })
            .then(() => {
                this.setSendingTransferFlag();
                this.sendTransfer();
            })
            .catch(() => {
                this.props.generateAlert(
                    'error',
                    t('fingerprintSetup:fingerprintAuthFailed'),
                    t('fingerprintSetup:fingerprintAuthFailedExplanation'),
                );
            });
    }
github iotaledger / trinity-wallet / src / mobile / src / ui / views / wallet / BiometricAuthentication.js View on Github external
deactivateFingerprintScanner() {
        const { t } = this.props;
        FingerprintScanner.authenticate({
            description: t('instructionsDisable'),
        })
            .then(() => {
                this.onSuccess();
            })
            .catch(() => {
                this.onFailure();
            });
    }

react-native-fingerprint-scanner

React Native Biometrics Scanner for Android and iOS

MIT
Latest version published 4 years ago

Package Health Score

51 / 100
Full package analysis