HeligPfleigh / react-native-thermal-receipt-printer

A RN library for thermal printer
155 stars 102 forks source link

BLEPrinter.init() seems to be null #171

Closed Fercho5656 closed 4 months ago

Fercho5656 commented 4 months ago
try {
    await BLEPrinter.init()
    const devices = await BLEPrinter.getDeviceList()
    setPrinters(devices)
    console.log(devices)
} catch (error) {
    console.error(error)
}

When I run init function, console returns this [TypeError: Cannot read property 'init' of null]

But if I print init function, it prints [Function init] so the function is actually not null

Even the BLEPrinter object shows the init function {"closeConn": [Function closeConn], "connectPrinter": [Function connectPrinter], "getDeviceList": [Function getDeviceList], "init": [Function init], "printBill": [Function printBill], "printText": [Function printText]}

software version
Android 14
react-native 0.72.6
node 18.12.1
npm or yarn npm