I am using phonegap build version cli-5.2.0 and the barcodescanner plugin.
I've added the plugin to the config.xml:
And then in my index.html page I've added:
<script>
function clickScan() {
alert('tester');
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>
THen a button:
<button onclick="clickScan();">Scan</button>
The alert is coming out but the scanner is not opening.
What I'm I doing wrong here?