android - PhoneGap Build Plugins -
i have been writing app in brackets , have been building phonegap build can have android , iphone versions programming on windows.
i trying use barcode scanner work in both android , iphone:
https://www.npmjs.com/package/phonegap-plugin-barcodescanner-quick
but directions type commands in cli, have not been using since have been suing phonegap build.
i tried adding code so:
$(document).ready(function () { //todo user id local storage var searchterm = window.localstorage.getitem("search"); var userid = window.localstorage.getitem("userid"); var history = []; var lastupdate = window.localstorage.getitem("searchupdatetime"); //todo scan stuff cordova.plugins.barcodescanner.scan( function (result) { alert("we got barcode\n" + "result: " + result.text + "\n" + "format: " + result.format + "\n" + "cancelled: " + result.cancelled); }, function (error) { alert("scanning failed: " + error); } ); ...
but when use phonegap desktop app on windows , android app scanner never opens.
update:
tried adding code project testing purposes, based on 1 of answers below, returned nothing: //todo scan stuff if (cordova.plugins.barcodescanner) {alert("have scanner object @ least...");} else{alert("nope");
this may not answer question, may help. have used same plugin maybe year ago, based on npm site instructs use command line interface install it. since page said install using command line, short snippet of code should work. since said using cloud build, there different way of adding plugin in app, using config.xml. here example of how this.
Comments
Post a Comment