PhoneGap BarcodeScanner 插件在基于 PhoneJS 的应用程序中不起作用...
插件 ID:com.phonegap.plugins.barcodescanner
从头开始创建一个 Cordova 项目插件工作正常,但在基于 PhoneJS 的模板中却不行!
这是我的代码:
MyApp.home = function (params) {
var viewModel = {
viewShown: function() {
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);
}
);
}
};
return viewModel;
};
我正在使用最新版本的插件 1.1.0、Adobe PhoneGap Build 来创建项目和 Galaxy Nexus 来测试应用程序。
没人解决???
谢谢...