Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The Phonegap Barcode Scanner don't recognize any barcode on windows phone

I'm trying to add the Phonegap Barcode scanner plugin to my Phonegap app. I'm primarily developing for windows phone 8 but I also want to target the ios and android platforms. I managed to add the plugin correctly, but when I start the scan, my windows phone doesn't recognize any barcodes. It just shows the video screen with a focus button and a green square.

Here's my code for the scan:

    function Scan() {
      window.plugins.barcodeScanner.scan(function (result) {
        barcode = result;
        alert(barcode.text);
      }, function (error) {
        alert("Scanning failed: " + error);
      });
  };

this function is called on deviceready event.

Am I doing something wrong? Or did I miss something in the plugin? I read that android and ios need to set permission to execute this plugin. Do I need permission to enable it to scan in windows phone too?

UPDATE :

It seems I can scan QR code but not the regular one(SCC code). Someone have a clue on this?

like image 769
Janick Isabelle Avatar asked Mar 15 '13 14:03

Janick Isabelle


1 Answers

Try using the ZXing Barcode Scanner for Windows Phone. It works quite well.

http://silverlightzxing.codeplex.com

You can call the class you create using PhoneGap. Then let the native plugin for ZXing do all the heavy work, and return back the code scanned to you in Javascript using the success function.

like image 135
SashaZd Avatar answered Nov 16 '22 02:11

SashaZd