januslo / react-native-bluetooth-escpos-printer

React-Native plugin for the bluetooth ESC/POS & TSC printers.
MIT License
368 stars 424 forks source link

Honeywell RP4 Thermal Bluetooth not printing #81

Open ikostic opened 5 years ago

ikostic commented 5 years ago

Hello,

I am working on React Native app which needs to print labels which will consist of text and barcode.

I am using Honeywell RP4 Thermal bluetooth printer.

The problem is that printLabel is returning success but not printing.

My print method looks like this:

printAddress = async () => {
    console.log('print address')
    BluetoothManager.scanDevices()
        .then((s)=> {
            var ss = JSON.parse(s)
            console.log('scan devices', ss)
            const pairedPrinter = ss.paired[0]
            BluetoothManager.connect(pairedPrinter.address)
                .then((s)=>{
                    console.log('printer connected')
                    BluetoothTscPrinter.printLabel(printOptions)
                        .then(()=>{
                            console.log('print options', printOptions)
                            console.log('print success')
                        },
                        (err)=>{
                            console.log('print error', err)
                        })
                },
                (err)=>{
                    console.log('printer connect error', err)
                })
        },
        (er)=> {
            console.log('scan devices error', er)
        })
}