Search code examples
angularjscordovaionic-frameworkbarcode-scanner

How to read CODE_128 with length = 50 characters ionic Cordova plugin barcode scanner


i'm trying to read a code bar with a length of 50 characters. Unfortunately, I'm not able to do that.

I changed more than one plugin with the same results (@red-mobile/cordova-plugin-barcodescanner, https://www.npmjs.com/package/cordova-plugin-qr-barcode-scanner-sdk33?activeTab=readme). I set the option "formats": "QR_CODE, CODE_128". Doesn't work. If I set "formats" to default, the plugin read the codebar as UPC_E: it's wrong. If I set the format correctly (I know for sure that's CODE_128), the scanner doesn't recognize the code bar. What could I do?

I'm using ionic cordova (10.0.0 ([email protected])), cordova-android@11, node 14.16.0


Solution

  • I have come across several issues pertaining to any barcode plugins that can be an issue:

    • Barcode label is too faded
    • Barcode is etched in product not a plastic label
    • Camera has no way to focus on barcode

    usually you need to place the phone in different positions and angles to hopefully scan the barcode, which is not an ideal case.

    Now I use: @capacitor-mlkit/barcode-scanning. It offers a way better experience than other barcode plugins and it works! Author provides example project as well!