cordova - Phonegap 3.5 and BarcodeScanner 2.0 -
I add the barcode scanner plugin to PhoneGrap 3.5 (final version, by NPM) and in a new project.
By the way it does not want to work. These days I have several tutorial / follow tips, different follow different guides and various PG versions and follow the efforts (initiated by up to) plug-ins of various Foucault (Official Fongap Klee suggested).
The problem is always the same: cordova.plugins.barcodeScanner raises an exception because the Cordova.plugin seems undefined.
The most affordable step I: the
phonegap create barcodeapp CD Barkodap Fongap plugin com.phonegap.plugins.barcodescanner phonegap run Android The code I used was
try {cordova.plugins.barcodeScanner.encode ("TEXT_TYPE", "http://www.nytimes.com", function (success) { Warning ("Successfully encode:" + success);}, function (failed) {warning ("Encoding failed:" + unsuccessful);}); } Hold (e) {warning (e); } I put it in the www / index.html file just after that initialize (); Do you remember what I'm missing?
Thanks
I think you need to add Android platform and your Cordova / PhoneGap need to run before the project is:
$ Cordowa make hello com.example.hello HelloWorld $ cd hello $ Cordowa platform Android $ Cordowa Build add $ Cordowa plugin com.phonegap.plugins. Barcodescanner Please follow this guide:
Comments
Post a Comment