Barcode Scanner not scanning the barcode correctly


I installed the Barcode Scanner Plugin (  and I tried to use it my app. 

I could implement it and I can actually use it to scan bar codes but the bar code result that it returns is seldom accurate. It often gets a few of the digits on the barcode incorrect, which means that is actually quite useless.

I would like to know if I am the only one having this issue and any recommendations on how to fix it will be great.

I also tried the Barcode Scanner Plugin posted on the forge. That component is working perfectly and is 100% accurate in its results but every once in a while it returns an error "cannot set property value of undefined" which I also don't know how to solve so I cannot use that one either.

I am not a java script expert so I dont know how to fix the scripts.

Any other suggestions?


Hi Vonnelize,

What type of barcodes are you trying to scan? Does it make a difference if you're scanning different types of barcodes? Does this behaviour occur on different devices?

Hi Kilian

I am mostly scanning normal EAN and UPC types of code as well as Code 39 and 128. I am getting incorrect readings on a Samsung S7, iPad Pro and iphone s6. Unfortunately I dont have more devices than these to test. Ideally I want the bar code result to be accurate regardless of the device that I use and the type that I am scanning.

Not sure if that will help you at all?

Well, the strange thing is that EANs at least have a check digit, so it shouldn't be possible to have inaccurate readings. And since you get these results on both Android [i]and[/i] iOS, I'm starting to wonder whether the codes you scan are correct at all... Where do they come from? And what kind of incorrect are we talking about? Random sequences, or always the same kind of incorrect? Can you post some images of these barcodes?

Hi Kilian

I am scanning all kinds of stuff that are sold in normal grocery stores. The idea is to be able to scan something and then know what it is called on the ERP system.

So, I am attaching a few pictures, one of the item I am scanning and screen shots of the various results I get while scanning this item. I used a Samsung S7 to scan.



I assume that if you use a random barcode scanning app on the Samsung the results are better? Most of the wrong results you're getting are 1 or 2 bit errors per numeral, and the check digit is ignored completely (instead recalculated). This doesn't look good for the barcode plug-in, but I can hardly imagine it being this broken...

I'm using the latest version of the barcode scanner and it is working on fine on Android. On iOS it does not detect barcodes, I am able to check if plugin is available and then launch it, the camera screen with the horizontal red line shows up but it does not detect any QR Codes. I am testing this on an iPhone 6 with OS 10.3.

Any clues on what is missing?

Hello Bharath, I also had various problems with the barcode scanner plugin on Apple devices. It was working well on Android devices but not on ios.

I then tried the barcode scanner available here:

This one had a different problem - also only on ios but the scanning results were better. 

As I am not a very technical programmer I then changed the above plugin to resolve the errors that I had and my scanner is working well now. 

I am attaching my version of the adapted plugin mentioned above - you will not be able to publish it but you can check my code and make the changes on your side and see if it helps. I made changes to the CheckBarcodeScannerPlugin client action.


Hi Vonnelize

Thanks for the attached code, I am able to get this plugin to work without your changes provided I use version 6.0.5 from Cordova directly. see post here for rationale

Just curious about your code. You have used an if widget with condition "1=1", wouldn't this always evaluate to true.



Hi Bharath, the if 1=1 is my way of commenting out code when I want to "bypass" code without deleting it if I want to re-use it again later on. So yes, the code on the false branch will never be executed. 

Hi Vonnelize,

Even easier is using "True" instead of "1=1" :).

Interesting, never thought how good old "commenting out" will work with widgets.