2

Working on using the datawedge plugin in my apache Cordova app. I have built the functions and getting a callback from the plugin. The problem is, its an object and I am not sure whats in the object. I am trying to console log, using the cordova plugin. In the log its returning [Object, Object]

What can I do to see whats in the object?

onDeviceReady: function() {

    LineaProCDV.initDT(onDeviceConnected, onBarcodeScanned);
    datawedge.start();

    datawedge.registerForBarcode(function(data) {
        console.log("Results!!!!!!!!!!!!!!!!!!!");
        console.debug(data);
    });

    app.receivedEvent('deviceready');
}

Thanks

jrock2004
  • 3,229
  • 5
  • 40
  • 73

2 Answers2

1

You could try using JSON.stringify(data) which will go to a certain depth of nested object. If you need to go deeper take a look at options here.

Community
  • 1
  • 1
Simon Prickett
  • 3,838
  • 1
  • 13
  • 26
0

Based on the answer given previously, to actually log the output of an object in Cordova:

console.log(JSON.stringify(data));
dariru
  • 501
  • 6
  • 16