leesiongchan / react-native-esc-pos

A React Native ESC/POS module to help you connect to your ESC/POS printer easily.
MIT License
80 stars 84 forks source link

How can I implement ScanDevices()? #72

Closed thiagopeluque closed 3 years ago

thiagopeluque commented 3 years ago

I tried to do like this

useEffect(() => { async function init() { const devices = await BluetoothSerial.scanDevices(); setDeviceList(devices); console.log(deviceList); } init();

return () => {
  async function remove() {
    await BluetoothSerial.stopScan();
    console.log('Stop Scan');
  }
  remove();
};

}, []);

It´s return an empty array

thiagopeluque commented 3 years ago

Anyone have an example??? please!!!