tr3v3r / react-native-esc-pos-printer

An unofficial React Native library for printing on an EPSON TM printer with the Epson ePOS SDK for iOS and Epson ePOS SDK for Android
MIT License
137 stars 64 forks source link

Printing Status #116

Closed danielminhnguyen closed 10 months ago

danielminhnguyen commented 10 months ago

Did anyone manage to get the printing status back?

 React.useEffect(() => {
    const sub = EscPosPrinter.addPrinterStatusListener((status) => {
      console.log('current printer status:', status);
    });

    return () => {
      sub();
    };
  }, []);

I am using both init and instantiate on EscPosPrinter, but the EscPosPrinter.startMonitorPrinter() always return unknown.

My printer is TM-m30II

current printer status: {"adapter": "UNKNOWN", "autoRecoverErr": "UNKNOWN", "batteryLevel": "UNKNOWN", "connection": "DISCONNECT", "coverOpen": "UNKNOWN", "drawer": "UNKNOWN", "errorStatus": "UNKNOWN", "online": "OFFLINE", "panelSwitch": "UNKNOWN", "paper": "UNKNOWN", "paperFeed": "UNKNOWN"}

danielminhnguyen commented 10 months ago

my installed package somehow missing ePOS2.h file, add that to package seems to fix the issue.