i'm trying create barcode scanner app using phonegap. testing on iphone 6s phonegap developer app.
when click scan button, nothing happens @ all.
aside editting index.html file , using phonegap desktop app server, there other steps need take?
this first hybrid app. target platform , version ios 9.
i using phonegap desktop app , phonegap development app on phone. need undertake step (build etc?) why it's not working?
here index.html page (copied on here, given working example):
<!doctype html> <html> <head> <meta charset="utf-8" /> <meta name="format-detection" content="telephone=no" /> <meta name="msapplication-tap-highlight" content="no" /> <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" /> <link rel="stylesheet" type="text/css" href="css/index.css" /> </head> <body> <button onclick="scanbarcode()">scan</button> <script type="text/javascript" src="cordova.js"></script> <script type="text/javascript" src="js/index.js"></script> <script> function scanbarcode(){ 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); } ); } </script> </body> </html>
Comments
Post a Comment