我正在尝试为phonegap(phonegap 5.1.1)添加条形码扫描程序插件,但我无法使其正常工作(https://github.com/phonegap/phonegap-plugin-barcodescanner)
首先,我安装了正在运行的插件:
phonegap插件添加phonegap-plugin-barcodescanner
然后我有一个javascript函数:
function leerBarCode(){
//navigator.notification.alert("LLega a leerBarCode", alertDismissed, "Mensaje", "OK");
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);
});
}
当我点击调用此功能的按钮时,它不会启动相机。拜托,你能帮帮我吗?