Problem with BarcodeScanner plugin since Graphite update

4 posts, 1 answers
  1. pistoleta
    pistoleta avatar
    4 posts
    Member since:
    May 2013

    Posted 02 Jul 2013 Link to this post

    Hi, im having problems with the barcodescanner plugin,

    whenever i call the function:
    var scanner = cordova.require("../cordova/plugin/BarcodeScanner"); 

    it doesnt work and this is what i see on the console log:
    Uncaught module ../cordova/plugin/BarcodeScanner not found (cordova.js:50)

    I used to have this in my index.html
    <script type="text/javascript" charset="UTF-8" src="Plugins/Barcode Scanner/barcodescanner.js"></script>
    But now it doesnt load it.... 

    Any suggestions?
    Thanks
  2. Answer
    Yavor Georgiev
    Admin
    Yavor Georgiev avatar
    982 posts

    Posted 02 Jul 2013 Link to this post

    Hello,

     The BarcodeScanner plugin isn't defined as a module using cordova.define and that's why you can't access it with cordova.require. You can access it by referencing the window.plugins.barcodeScanner object.

    Regards,
    Yavor Georgiev
    Telerik

    Looking for tips & tricks directly from the Icenium team? Check out our blog!
    Missed our first webinar, watch it here.
    Share feedback and vote for features on our Feedback Portal.
  3. pistoleta
    pistoleta avatar
    4 posts
    Member since:
    May 2013

    Posted 02 Jul 2013 Link to this post

    Thanks a lot, i changed that code cause i needed it when i was working on phonegap, now i dont need it anymore.
    Still, i dont understand why it differs from phonegap if they are supposed to use the same cordova libraries..

    Thanks again
  4. pistoleta
    pistoleta avatar
    4 posts
    Member since:
    May 2013

    Posted 02 Jul 2013 Link to this post

    Thanks a lot!!!
Back to Top