AllInOneYT / react-native-thermal-printer

MIT License
102 stars 53 forks source link

ios + TypeError: Cannot read property 'printTcp' of null #51

Closed geoff8888 closed 1 year ago

geoff8888 commented 1 year ago

This works on Android, but not on ios.

`

ThermalPrinterModule.defaultConfig.ip = "192.168.5.153"; ThermalPrinterModule.defaultConfig.port = 9100; ThermalPrinterModule.defaultConfig.autoCut = false; ThermalPrinterModule.defaultConfig.timeout = 5000;

try {                           

        await ThermalPrinterModule.printTcp({ payload: "This is a test\n\n" });

    } catch(printError) {
        console.error(printError);
        return false;
    }`

Error Result ERROR [TypeError: Cannot read property 'printTcp' of null]

During startup

`

WARN Module ThermalPrinter requires main queue setup since it overrides init but doesn't implement requiresMainQueueSetup. In a future release React Native will default to initializing all native modules on a background thread unless explicitly opted-out of. `

"react-native": "0.71.7", "react-native-thermal-printer": "^2.3.5",

Just tested bluetooth Cannot read property 'printBluetooth' of null

AllInOneYT commented 1 year ago

We only bridged the android printing library. No IOS support at the moment.