How to use the react-native-ble-plx.BleErrorCode.BluetoothUnauthorized function in react-native-ble-plx

To help you get started, we’ve selected a few react-native-ble-plx 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 LedgerHQ / ledger-live-mobile / src / screens / PairDevices / RenderError.js View on Github external
render() {
    const { error, status, onBypassGenuine, onRetry } = this.props;

    // $FlowFixMe
    if (error.errorCode === BleErrorCode.LocationServicesDisabled) {
      return ;
    }

    // $FlowFixMe
    if (error.errorCode === BleErrorCode.BluetoothUnauthorized) {
      return ;
    }

    const isPairingStatus = status === "pairing";
    const isGenuineCheckStatus = status === "genuinecheck";
    const url = (isPairingStatus && urls.errors.PairingFailed) || undefined;

    const outerError = isPairingStatus
      ? new PairingFailed()
      : isGenuineCheckStatus
      ? new GenuineCheckFailed()
      : null;

    return (