Cordova Barcode scanner plugin for Linea Pro devices (iOS only), modified from com.citronium.lineaprocdv.v2 0.1
Install with cordova plugin add https://github.com/domisginger/cordova-plugin-lineabarcode
Will add the following into info.plist:
- com.datecs.linea.pro.msr
- com.datecs.iserial.communication
- com.datecs.pinpad
- com.datecs.linea.pro.bar
Call on app start to connect device, every barcode scanned will trigger cardCallback();
LineaBarcode.initLinea(
connectionCallback => { }, //Connection Changed Callback (int) - 2 is connected
cardCallback => { }, //Magnetic Card Reader Callback (Track1 + Track2 + Track3)
barcodeCallback => { }, //Barcode Reader Callback ({format: string, cancelled: boolean, text: string})
success => { },
error => { }
);
Turn on/off beep when barcode scanned (on by default, not persistant on app restart)
LineaBarcode.barcodeSetScanBeepOff();
LineaBarcode.barcodeSetScanBeepOn();
Turn on/off the physical button activating the barcode reader (on by default, not persistant on app restart)
LineaBarcode.barcodeButtonDisable();
LineaBarcode.barcodeButtonEnable();
Manually start or stop the barcode reader (turn on barcode light and attempt scanning without pressing physical button)
LineaBarcode.barcodeStart();
LineaBarcode.barcodeStop();
Used for iOS device syncing, while on the barcode scanner wont work
LineaBarcode.barcodeSetPassThroughSyncOn();
LineaBarcode.barcodeSetPassThroughSyncOff();
Charge the iOS device from the Linea Device's battery pack
LineaBarcode.barcodeSetChargeDeviceOn();
LineaBarcode.barcodeSetChargeDeviceOff();