How to use the react-native-keychain.getSupportedBiometryType function in react-native-keychain

To help you get started, we’ve selected a few react-native-keychain 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 oblador / react-native-keychain / test_index.js View on Github external
};

const simpleOptions: Options = {
  accessControl: ACCESS_CONTROL.BIOMETRY_ANY,
  accessible: ACCESSIBLE.ALWAYS,
  authenticationType: AUTHENTICATION_TYPE.BIOMETRICS,
  accessGroup: 'accessGroup',
  authenticationPrompt: 'authenticationPrompt',
  service: 'service',
};

canImplyAuthentication(simpleOptions).then(result => {
  (result: boolean);
});

getSupportedBiometryType().then(result => {
  (result: ?string);
});

// $FlowExpectedError - First 3 arguments are required
setInternetCredentials();
setInternetCredentials('server', 'username', 'password');
setInternetCredentials('server', 'username', 'password', simpleOptions).then(
  result => {
    (result: void);
  }
);

// $FlowExpectedError - First argument is required
hasInternetCredentials();
hasInternetCredentials('server').then(result => {
  (result: boolean);
github pillarwallet / pillarwallet / src / screens / PinCodeUnlock / PinCodeUnlock.js View on Github external
componentDidMount() {
    addAppStateChangeListener(this.handleAppStateChange);
    const { useBiometrics } = this.props;
    const { lastAppState } = this.state;

    if (!this.errorMessage && DEFAULT_PIN) {
      this.handlePinSubmit(DEFAULT_PIN);
    }

    if (useBiometrics
      && !this.errorMessage
      && lastAppState !== BACKGROUND_APP_STATE) {
      Keychain.getSupportedBiometryType()
        .then((biometryType) => {
          this.setState({ supportedBiometryType: getBiometryType(biometryType) });
          this.showBiometricLogin();
        })
        .catch(() => null);
    }
    this.handleLocking(true);
  }
github pillarwallet / pillarwallet / src / screens / PinCodeConfirmation / PinCodeConfirmation.js View on Github external
handlePinSubmit = (pin: string) => {
    const { wallet: { onboarding: wallet }, confirmPinForNewWallet, navigation } = this.props;
    const previousPin = wallet.pin;
    const validationError = validatePin(pin, previousPin);

    if (validationError) {
      this.setState({
        errorMessage: validationError,
      });
      return;
    }

    Keychain.getSupportedBiometryType()
      .then((biometryType) => {
        if (biometryType) {
          navigation.navigate(BIOMETRICS_PROMPT, { biometryType });
          confirmPinForNewWallet(pin);
        } else {
          confirmPinForNewWallet(pin, true);
        }
      })
      .catch(() => { confirmPinForNewWallet(pin, true); });
  };
github oblador / react-native-keychain / KeychainExample / App.js View on Github external
componentDidMount() {
    Keychain.getSupportedBiometryType().then(biometryType => {
      this.setState({ biometryType });
    });
  }
github pillarwallet / pillarwallet / src / screens / Settings / Settings.js View on Github external
componentDidMount() {
    Keychain.getSupportedBiometryType()
      .then(supported => this.setState({ showBiometricsSelector: !!supported }))
      .catch(() => null);
  }
github pillarwallet / pillarwallet / src / screens / Profile / Profile.js View on Github external
componentDidMount() {
    const { logScreenView } = this.props;

    logScreenView('View profile', 'Profile');

    Keychain.getSupportedBiometryType()
      .then(supported => this.setState({ showBiometricsSelector: !!supported }))
      .catch(() => null);
  }
github pillarwallet / pillarwallet / src / screens / Assets / Assets.js View on Github external
const {
      fetchInitialAssets,
      fetchAllCollectiblesData,
      assets,
      logScreenView,
    } = this.props;

    logScreenView('View assets list', 'Assets');

    if (!Object.keys(assets).length) {
      fetchInitialAssets();
    }

    fetchAllCollectiblesData();

    Keychain.getSupportedBiometryType()
      .then(supported => this.setState({ supportsBiometrics: !!supported }))
      .catch(() => null);
  }
github LedgerHQ / ledger-live-mobile / src / screens / Settings / General / ConfirmPassword.js View on Github external
componentDidMount() {
    Keychain.getSupportedBiometryType().then(biometricsType => {
      if (biometricsType) this.setState({ biometricsType });
    });
  }