thiendangit / react-native-thermal-receipt-printer-image-qr

React native thermal receipt printer
https://www.npmjs.com/package/react-native-thermal-receipt-printer-image-qr
111 stars 73 forks source link

Null Object Reference while calling getDeviceList #89

Open abinayasejeeth opened 1 year ago

abinayasejeeth commented 1 year ago

"Attempt to invoke interface method 'java.util.List com.pinmi.react.printer.adapter.PrinterAdapter.getDeviceList(com.facebook.react.bridge.Callback)' on a null object reference"

andriyandriyan commented 1 year ago

I found the solution of this error. You have to call this function before call getDeviceList()

BLEPrinter.init().then(() => {
      BLEPrinter.getDeviceList()
        .then(setPrinters);
});