title: cordova plugin - pass a js function to native code
body: <p>I am trying to write a Cordova plugin which will start a thread to collect info periodically. </p>
  
  <p>one of the info is maintain in js layer. So I need provide a js getter function to be called by native code.</p>
  
  <p>Here is the demo code:</p>
  
  <pre><code>in js:
  var getInfo = function() {
  
    xxxxxxxxxxxxxxx
  
    return jsInfo;
  }
  
  // call my plugin
  cordova.startCollectInfo(getInfo)
  </code></pre>
  
  <p>How can I make java code call <code>getInfo</code> and get the value of jsInfo?</p>