0
votes

I'm trying to use cordova-barcodescanner-plugin in my ionic project compiled with PhoneGap Build.

https://github.com/hypery2k/cordova-barcodescanner-plugin

When i try to use barcode scanner on iOS devices, my app open barcode correctly but doesn't scan (capture) qrcode.

My config.xml declaration is gap:plugin name="cordova-plugin-barcodescanner" source="npm"

and my test code is:

cordova.plugins.barcodeScanner.scan( 
function (result) { 
  if(result.cancelled) 
    return; 
  alert(result.text); 
}, 
function (error) { 
  alert("Error scan"); 
});

Have you notice of the same problem.

2

2 Answers

1
votes

Try using the official plugin. It have better support.

https://github.com/phonegap/phonegap-plugin-barcodescanner

0
votes

I also tried using old version of cli (5.1.1) with 2 plugin:

cordova-barcodescanner-plugin

phonegap-plugin-barcodescanner

**In my PGB app there is PhoneGap (iOS / Android / Windows)

cli-5.1.1 (3.8.0 / 4.0.2 / 3.8.1)**

Nothing change. When i try to use barcode scanner on iOS device, my app open barcode correctly but doesn't scan (capture) qrcode.

There is an issue opened on Github: https://github.com/phonegap/phonegap-plugin-barcodescanner/issues/173