ios - Can't use Barcode scanner in Cordova (plugin is installed). -


i'm having problem cordova app when trying use barcode scanner plugin.

the plugin seems installed correctly, since when type in cordova plugin ls response:

    [ 'com.phonegap.plugins.barcodescanner',   'org.apache.cordova.console' ] 

however tried multiple ways of triggering scanner none worked. copied barcodescanner.js www folder , in index.html if read it's not necessary anymore. suggested way in read-me file is:

cordova.plugins.barcodescanner.scan() 

which didn't work out. tried numerous other things none of them worked. i'm hoping here encountered same issue , found solution. i'm testing ios app version.

add config.xml

<feature name="barcodescanner">     <param name="android-package" value="com.phonegap.plugins.barcodescanner.barcodescanner" /> </feature> 

and while using plugin

function clickscan() { 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);   });} 

Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -