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.

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 <LocationRequired onRetry={onRetry} errorType="disabled" />;
    }

    // $FlowFixMe
    if (error.errorCode === BleErrorCode.BluetoothUnauthorized) {
      return <LocationRequired onRetry={onRetry} errorType="unauthorized" />;
    }

    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 (
      <View style={styles.root}>
        <TrackScreen category="PairDevices" name="Error" />

react-native-ble-plx

React Native Bluetooth Low Energy library

Apache-2.0
Latest version published 11 months ago

Package Health Score

72 / 100
Full package analysis

Similar packages