react native module for printing receipt on pos printer. (only support for android)
npm install react-native-pos-printer
import PosPrinter from 'react-native-pos-printer';
Initializes printer, the return will be Promise
PosPrinter.init(isDebug?)
.then((res) => console.log(res))
.catch((err) => console.log(err));
Get all printer devices, the return will be Promise<Printer[]>
PosPrinter.getDevices()
.then((device) => console.log(device))
.catch((err) => console.log(err));
Scan all devices printer, the return will be Promise
PosPrinter.scanDevices()
.then((res) => console.log(res))
.catch((err) => console.log(err));
Stop scanning all devices printer, the return will be Promise
PosPrinter.stopScanDevices()
.then((res) => console.log(res))
.catch((err) => console.log(err));
Connect to specific pos printer, the return will be Promise
PosPrinter.connectDevice(deviceId, timeout)
.then((res) => console.log(res))
.catch((err) => console.log(err));
Test print on pos printer
PosPrinter.printTestReceipt(storageUrl?)
.then((res) => console.log(res))
.catch((err) => console.log(err));
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
Made with create-react-native-library