headuck / react-native-zebra-rfid

React native module for Zebra RFID reader (Android only)
23 stars 17 forks source link

cannot connect with the device. #6

Open ahoirg opened 3 years ago

ahoirg commented 3 years ago

The reader and the mobile device are connected by Bluetooth. It cannot be paired with the device and application on rfid.init() . There is no pairing sound from the device. I can see the logs in the console. I did not get an error.

export default class RfidScan extends Component {
  rfid = new RFIDScanner();

  onRfidResult = (tags) => {
    console.info(' TAGS: ' + JSON.stringify(tags));
  };

  componentDidMount() {

    console.info("componentDidMountBeforeInit");

    this.rfid.init();

    console.info("componentDidMountAfterInit");

    this.rfid.on(RFIDScannerEvent.TAGS, this.onRfidResult);

    console.info("componentDidMountAfterOn");

  }

  componentWillUnmount(){
    console.info("BeforeShutDown");
    this.rfid.shutdown();
    console.info("AfterShutDown");
  }

  render() {return(<View style={{flex:1}}></View>); }
}
viliammojsky commented 2 years ago

The reader and the mobile device are connected by Bluetooth. It cannot be paired with the device and application on rfid.init() . There is no pairing sound from the device. I can see the logs in the console. I did not get an error.

export default class RfidScan extends Component {
  rfid = new RFIDScanner();

  onRfidResult = (tags) => {
    console.info(' TAGS: ' + JSON.stringify(tags));
  };

  componentDidMount() {

    console.info("componentDidMountBeforeInit");

    this.rfid.init();

    console.info("componentDidMountAfterInit");

    this.rfid.on(RFIDScannerEvent.TAGS, this.onRfidResult);

    console.info("componentDidMountAfterOn");

  }

  componentWillUnmount(){
    console.info("BeforeShutDown");
    this.rfid.shutdown();
    console.info("AfterShutDown");
  }

  render() {return(<View style={{flex:1}}></View>); }
}

Hi, have you found any solution to this?