How to use expo-local-authentication - 6 common examples

To help you get started, we’ve selected a few expo-local-authentication 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 janaagaard75 / expo-and-typescript / src / LocalAuthenticationScreen.tsx View on Github external
private async updateState() {
    this.setState({
      hasHardware: await LocalAuthentication.hasHardwareAsync()
    });
  }
}
github expo / expo / apps / native-component-list / src / screens / LocalAuthenticationScreen.tsx View on Github external
async checkDevicePossibilities() {
    const hasHardware = await LocalAuthentication.hasHardwareAsync();
    const isEnrolled = await LocalAuthentication.isEnrolledAsync();

    this.setState({ hasHardware, isEnrolled });
  }
github expo / expo / apps / native-component-list / src / screens / LocalAuthenticationScreen.tsx View on Github external
async checkDevicePossibilities() {
    const hasHardware = await LocalAuthentication.hasHardwareAsync();
    const isEnrolled = await LocalAuthentication.isEnrolledAsync();

    this.setState({ hasHardware, isEnrolled });
  }
github expo / expo / apps / native-component-list / src / screens / LocalAuthenticationScreen.tsx View on Github external
.map(type => {
        switch (type) {
          case LocalAuthentication.AuthenticationType.FINGERPRINT:
            return 'FINGERPRINT';
          case LocalAuthentication.AuthenticationType.FACIAL_RECOGNITION:
            return 'FACIAL_RECOGNITION';
          default:
            throw new Error(`Unrecognised authentication type returned: '${type}'`);
        }
      })
      .join(', ');
github janaagaard75 / expo-and-typescript / src / LocalAuthenticationScreen.tsx View on Github external
private async authenticate() {
    const authenticated = await LocalAuthentication.authenticateAsync({
      promptMessage: "Authentication message"
    });

    if (authenticated.success) {
      this.setState({
        authenticationError: "None"
      });
    } else {
      this.setState({
        authenticationError: authenticated.error
      });
    }

    this.setState({
      authenticated: authenticated.success
    });
github expo / expo / apps / native-component-list / src / screens / LocalAuthenticationScreen.tsx View on Github external
checkAuthenticationsTypes = async () => {
    const result = await LocalAuthentication.supportedAuthenticationTypesAsync();
    const stringResult = result
      .map(type => {
        switch (type) {
          case LocalAuthentication.AuthenticationType.FINGERPRINT:
            return 'FINGERPRINT';
          case LocalAuthentication.AuthenticationType.FACIAL_RECOGNITION:
            return 'FACIAL_RECOGNITION';
          default:
            throw new Error(`Unrecognised authentication type returned: '${type}'`);
        }
      })
      .join(', ');
    alert(stringResult ? `Available types: ${stringResult}` : 'No available authentication types!');
  };

expo-local-authentication

Provides an API for FaceID and TouchID (iOS) or the Fingerprint API (Android) to authenticate the user with a face or fingerprint scan.

MIT
Latest version published 3 months ago

Package Health Score

89 / 100
Full package analysis