import { BarcodeScanner } from 'ionic-native';
...
BarcodeScanner.scan().then((barcodeData) => {
// Success! Barcode data is here
}, (err) => {
// An error occurred
});
Can you provide insight to getting a QR code reader working in Ionic 2 in the browser? I have control of the camera and canvas, but I can’t find a way to feed the canvas into a library for decoding the QR code.
I should have mentioned that I’m trying to use a barcode scanner in the browser instead of iOS/Android.
ionic serve seems to stop some cordova plugins, even after reinstalling cordova. Here’s the error I get:
Native: tried calling BarcodeScanner.scan, but Cordova is not available. Make sure to include cordova.js or run in a device/simulator
Scanning failed: cordova_not_available
Hello @ryanlogsdon (and everyone)
Did you manage to make this work on browser?
I searched the forum for this topic and couldn’t find it, so I started a new thread about what it meant for a plugin when it states “compatible with browser platform”, but it is basically the same issue (because it is the QR Scanner plugin), and I came accross this thread just now…
ShamelessPlug:Scandit is a subscription service… That’s not really a good solution… :-S