I'd like to print base64 image using printImageBase64() function. In Android, it's working well.
In iOS, successfully pod installed and build is successful. But when run on my device and call NetPrinter related functions, it's getting TCP Disconnected error continuously and app stopped after some time.
I'd like to print base64 image using printImageBase64() function. In Android, it's working well. In iOS, successfully pod installed and build is successful. But when run on my device and call NetPrinter related functions, it's getting TCP Disconnected error continuously and app stopped after some time.
react : 18.2.0 react-native : 0.72 react-native-thermal-receipt-printer-image-qr : 0.1.11
import React, {useEffect} from 'react'; import { SafeAreaView, ScrollView, View, Text, StatusBar, } from 'react-native'; import { NetPrinter, NetPrinterEventEmitter, RN_THERMAL_RECEIPT_PRINTER_EVENTS } from 'react-native-thermal-receipt-printer-image-qr';
const App = () => {
useEffect(() => { const initPrinterFunc = async () => { NetPrinter.init().then(() => { console.log("initialized Net printer...") }); const results = await NetPrinter.getDeviceList(); console.log("results >> ", results); };
}, []);
useEffect(() => {
return () => { NetPrinterEventEmitter.removeAllListeners( RN_THERMAL_RECEIPT_PRINTER_EVENTS.EVENT_NET_PRINTER_SCANNED_SUCCESS, ); NetPrinterEventEmitter.removeAllListeners( RN_THERMAL_RECEIPT_PRINTER_EVENTS.EVENT_NET_PRINTER_SCANNED_ERROR, ); }; }, []);
return ( <>
); };
export default App;