Question

This new phonegap overhaul has been a headache, but I've finally managed to get this particular plugin working on my device (sort of). However it seems that only QR codes are working; any other barcodes it just does not detect them. It does not fail or anything, it just stays on the camera screen waiting for a barcode. This same plugin however works just fine on Android for the same application and barcodes that I am trying to run on the iOS platform.

I used this particular github fork: https://github.com/jonathannaguin/BarcodeScanner

Since the official one linked in the compatible plugins list for Phonegap 3.0 does not actually work: https://github.com/wildabeast/BarcodeScanner

Does anyone have any idea what might cause this to occur? This is how I am calling the scan:

plugins.barcodeScanner.scan(
  function (result) {
      //alert("We got a barcode\n" +
       //     "Result: " + result.text + "\n" +
      //      "Format: " + result.format + "\n" +
       //     "Cancelled: " + result.cancelled);
       document.getElementById("TextBox1").value = result.text;
  }, 
  function (error) {
      alert("Scanning failed: " + error);
  }
);

Let me know if there is any other information I need to present to help with this problem.

Was it helpful?

Solution

Turns out the issue is related to the camera on my device being extremely blurry, and me not realizing that the iOS plugin does not support all the same types of barcodes that the Android plugin does. When I tried example barcodes for each supported type (by googling them) it mostly worked; the exception being smaller barcodes.

iOS tablets and iTouchs don't have the same quality camera that the iphones carry, which is unfortunate.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top