BarcodeScanner icon indicating copy to clipboard operation
BarcodeScanner copied to clipboard

Running barcodeScanner in WP8.1

Open pr4v33nv3rm4 opened this issue 9 years ago • 4 comments

hi i am new to apache cordova app development and just want to test wildabeast/BarcodeScanner on my windows phone 8.1 i am using Visual Studio 2013 with VS Tools for Apache Cordova CTP3.0

I deployed hello world app and it is working fine in my phone.But having issues to run the example given here for barcode scanner.

I have below queries

  1. which version of cordova is required to make it work.
  2. Is there any tutorial for WP please share the link.

pr4v33nv3rm4 avatar Mar 11 '15 09:03 pr4v33nv3rm4

hi,

I did some reading here and able to compile it without errors. The problem..i was using cordova.require() which is deprecated as i read somewhere.

As scanner can't be tested in simulators i am using my lumia525(WP8.1) to test but when i click the scan button it only opens the camera and there is no scanning going on. Also back button is performing very slow.

below is my index,html appreciate if someone can tell what i am missing.

<script type="text/javascript" charset="utf-8" src="cordova.js"></script>
<script type="text/javascript" src="barcodescanner.js"></script>
<script type="text/javascript">
    function scancode() {
        cordova.plugins.barcodeScanner.scan(
      function (result) {
          alert("We got a barcode\n" +
                "Result: " + result.text + "\n" +
                "Format: " + result.format + "\n" +
                "Cancelled: " + result.cancelled);
      },
      function (error) {
          alert("Scanning failed: " + error);
      }
   );
    }
</script>
</head>
<body>
    <input type="button" value="scan" onclick="scancode()" />
</body>

pr4v33nv3rm4 avatar Mar 13 '15 03:03 pr4v33nv3rm4

From what I understand, BarcodeScanner simply does not work in 8.1. It does work if you build for 8.0, but of course this restricts you to building for cordova-wp8 instead of cordova-windows. This is a problem for me right now too, and I've been scouring forks of this project for a solution.

Currently though, it looks like I need to rebase my WP project on 8.0.

dougestey avatar Apr 07 '15 13:04 dougestey

Maybe related issue: https://github.com/wildabeast/BarcodeScanner/issues/172

SunboX avatar Jun 26 '15 07:06 SunboX

I had to rebase it to 8.0 and yup used windows wp8 instead of apache cordova. Another thing was had to switch back to VS2012 again as VS2013 not support 8.0 project creation although you can create a project in VS2012 targeting 8.0 and use VS2013 for further development.

pr4v33nv3rm4 avatar Jun 26 '15 09:06 pr4v33nv3rm4