How to use the react-native-ble-manager.checkState function in react-native-ble-manager

To help you get started, we’ve selected a few react-native-ble-manager 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 adafruit / glider / App.js View on Github external
useEffect(() => {
        if (currentAppState === 'active') {
          console.log('App has come to the foreground!', bleState);
          BleManager.start({showAlert: true});
          BleManager.checkState();
        } else {
            if (peripheral) {
              changeCode({"type": "disconnect", "peripheral_id": peripheral.id});
              BleManager.disconnect(peripheral.id);
            }

            setBleState("disconnected");
        }
    }, [currentAppState]);