Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8035139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:13:32+00:00 2026-06-05T02:13:32+00:00

Has anyone managed to get the BarcodeScanning plugin for PhoneGap to work on PhoneGap

  • 0

Has anyone managed to get the BarcodeScanning plugin for PhoneGap to work on PhoneGap 1.7.0?

Barcode Scanning plugin: https://github.com/phonegap/phonegap-plugins/tree/master/iOS/BarcodeScanner

The issues is that the plugin is not getting set when its added..

I get the following when I call “alert(window.plugins.barcodeScanner);”

“undefined”

I am trying to isolate the point where the plugin is failing to get added and will update the question once I know more..

Thanks in advance for anyone who can help…


Updated answer below:

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T02:13:34+00:00Added an answer on June 5, 2026 at 2:13 am

    OK so after a bit of poking around and using the twitter PhoneGap plugin as an example I managed to get it working!!

    I used this as a basis for my approach because the lovely people at twitter updated their plugin to work with PhoneGap 1.7.0 thank god!!

    Twitter PhoneGap Plugin: https://github.com/phonegap/phonegap-plugins/blob/master/iOS/Twitter/js/TwitterPlugin.js

    Here is the updated barcodescanner.js code:

    var BarcodeScanner = function(){};
    
    BarcodeScanner.prototype.isBarcodeScannerAvailable = function(response){
        cordova.exec(response, null, "BarcodeScannerPlugin", "isBarcodeScannerAvailable", []);
    };
    
    BarcodeScanner.prototype.isBarcodeScannerSetup = function(response){
        cordova.exec(response, null, "BarcodeScannerPlugin", "isBarcodeScannerSetup", []);
    };
    
    //-------------------------------------------------------------------
    BarcodeScanner.Encode = {
    TEXT_TYPE:     "TEXT_TYPE",
    EMAIL_TYPE:    "EMAIL_TYPE",
    PHONE_TYPE:    "PHONE_TYPE",
    SMS_TYPE:      "SMS_TYPE",
    CONTACT_TYPE:  "CONTACT_TYPE",
    LOCATION_TYPE: "LOCATION_TYPE"
    }
    
    //-------------------------------------------------------------------
    BarcodeScanner.prototype.scan = function(success, fail, options) {
        function successWrapper(result) {
            result.cancelled = (result.cancelled == 1)
            success.call(null, result)
        }
    
        if (!fail) { fail = function() {}}
    
        if (typeof fail != "function")  {
            console.log("BarcodeScanner.scan failure: failure parameter not a function")
            return
        }
    
        if (typeof success != "function") {
            fail("success callback parameter must be a function")
            return
        }
    
        if ( null == options ) 
            options = []
    
            return PhoneGap.exec(successWrapper, fail, "com.cordova.barcodeScanner", "scan", options)
            }
    
    //-------------------------------------------------------------------
    BarcodeScanner.prototype.encode = function(type, data, success, fail, options) {
        if (!fail) { fail = function() {}}
    
        if (typeof fail != "function")  {
            console.log("BarcodeScanner.scan failure: failure parameter not a function")
            return
        }
    
        if (typeof success != "function") {
            fail("success callback parameter must be a function")
            return
        }
    
        return PhoneGap.exec(success, fail, "com.cordova.barcodeScanner", "encode", [{type: type, data: data, options: options}])
    }
    
    cordova.addConstructor(function() {
    
                           /* shim to work in 1.5 and 1.6  */
                           if (!window.Cordova) {
                           window.Cordova = cordova;
                           };
    
    
                           if(!window.plugins) window.plugins = {};
                           window.plugins.barcodeScanner = new BarcodeScanner();
                           });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Has anyone managed to get a DBLookupComboBox to work with a DBCtrlGrid ? A
Has anyone managed to get this to work? Closest I have found is a
Has anyone managed to get ASP.NET Forms Authentication (with cookies) working with a PhoneGap
Has anyone managed to get administration rights through the UAC without restarting the application
Has anyone managed to get the transfer mechanism working with FILESTREAM columns? My code
Has anyone managed to get subsonic or a variant working on Windows Mobile? We
Has anyone managed to use ItemizedOverlays in Android Beta 0.9? I can't get it
Has anyone managed to get the gesture recognition working in cocos-2d? I have read
Has anyone managed to get the new Infinitest open source version running in IntelliJ
Has anyone managed to get OpenGL ES 2.0 working in a live wallpaper? I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.