Open aasuparekh1 opened 11 months ago
@aasuparekh1 same error here, do you manage to find a solution? Cheers.
@marceloch2 @aasuparekh1 Same issue does anyone got the solution?
@Hasham24 @aasuparekh1 I'm using NetPrinter.printRawData(decodedReceipt), maybe not related but you have a typo. "prinRawData", so "prin" instead of "print"
I'm able to use this printRawData using a fork that I did, I can't remember right now what I did, but you can try just to see if works https://github.com/marceloch2/react-native-thermal-receipt-printer And RC version: "react-native": "0.73.6",
**- This code are curranty running in my app.
*Code**
const [printers, setPrinters] = useState([]); const [currentPrinter, setCurrentPrinter] = useState();
useEffect(() => { BLEPrinter.init().then(()=> { BLEPrinter.getDeviceList().then(setPrinters); }); }, []);
_connectPrinter => (printer) => { //connect printer BLEPrinter.connectPrinter(printer.inner_mac_address).then( setCurrentPrinter, error => console.warn(error)) }
printTextTest = () => { currentPrinter && USBPrinter.printText("sample text \n");
}
printBillTest = () => { currentPrinter && USBPrinter.printBill("sample bill ");
}
...
return (
)
* Issue : Attempt to invoke interface metho 'void com.pinmi.react.printer.adapter.Printer Adapter.prinRawData(java.lang.String,com.facebook.react.bridge.Callback)' on a null object reference
Expected Behavior
Environment