19

I have successfully followed this thread
Phonegap 3.0.0: BarcodeScanner Plugin

But it seems like it cannot scan Qr Code. Here is the screen shot from phone:

enter image description here

I have tried scanning a barcode image and it works fine. But not with QR images.
Any idea?

EDIT

    var scanner = cordova.require("com.phonegap.plugins.barcodescanner.barcodescanner");

    scanner.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);
        }
    );  

EDIT 2
DuuhhH!!! The problem was the QR image, it has no margin as Sean Owen said.

Community
  • 1
  • 1
fiberOptics
  • 6,955
  • 25
  • 70
  • 105
  • 2
    It's fine to me if you don't like the question and decide to close it. But can you please give some reason? I've been spending hours solving my problem. – fiberOptics Oct 09 '14 at 16:19
  • 8
    That QR code does not have a margin, which is probably why it won't scan. – Sean Owen Oct 09 '14 at 16:25
  • 3
    OMG, you're right. The QR code I used was generated from our api service. Basically it has no margin. Didn't know it was important. Thanks!!!! – fiberOptics Oct 09 '14 at 16:31
  • what about other QR image? I see QR Scanner app (in Apple store) can scan every QR image. – Tran Trung Hieu Aug 10 '16 at 10:25

1 Answers1

19

Copying from my comment as it seems to be the answer: That QR code does not have a margin, which is probably why it won't scan.

Sean Owen
  • 66,182
  • 23
  • 141
  • 173