bitpay / cordova-plugin-qrscanner

A fast, energy efficient, highly-configurable QR code scanner for Cordova apps and the browser.
MIT License
568 stars 772 forks source link

feat(ios,android): Adds support for barcodes #256

Open tymarats opened 5 years ago

tymarats commented 5 years ago

This PR adds support for scanning barcodes of various formats. You can use it like this:

            QRScanner.prepare((err, status) => {
                // ...
            }, { formats: [ 'CODE_128', 'QR_CODE', 'EAN_13' ] });

or:

            QRScanner.scan((err, text) => {
                // ...
            }, { formats: [ 'AZTEC', 'QR_CODE', 'PDF_417' ] });

If options object is not provided, it behaves exactly as the original (only QR codes are being recognized).

thebarty commented 4 years ago

Please merge this pull-request in.

thebarty commented 4 years ago

NOTE that this has been released on NPM as https://www.npmjs.com/package/cordova-plugin-qrscanner-codaxy

Stun3R commented 3 years ago

@thebarty Hi, Do you know how to handle that with ionic ?

ayubUOL commented 2 years ago

@thebarty Hi, Can you tell how to import it after installation ?

cyptus commented 2 years ago

@tymarats does this fork work with browser plattform?

tymarats commented 2 years ago

@cyptus Thank you for reaching out via email. Just to reply here as well (based on your inputs), in case someone else has the same question in the future.

As you noticed, the browser platform is using qrcode-reader, and that package apparently does not support barcode scanning. So, the question really is if it can be added to qrcode-reader (in which case we should just update the package dependency and rebuild), or if we can use another library that supports both QR and barcode decoding. Unfortunately, we are not actively maintaining this plugin (and the browser platform was out of our scope to begin with), so it's not likely that anyone from our side will pick it up in the foreseeable future :(