title: Calling javascript from objective-c in cordova
body: <p>I'm using the cordova 4.2.1 framework in iOS objective-c app. At a random moment I would like to call from objective-c a javascript function which resides in www folder.</p>
  
  <p>I have tried as a starting point to call from javascript side a native function, i.e. </p>
  
  <pre><code>cordova.exec("function(){}", null, 'MyPlugin', "MyCommand", []);
  </code></pre>
  
  <p>Then in myCommand in objective-c I had </p>
  
  <pre><code>[self.commandDelegate evalJs:@"alert(1);"];
  </code></pre>
  
  <p>and it was working fine.</p>
  
  <p>However what I would like is from AppDelegate.m, to call MyCommand and trigger a javascript function.</p>
  
  <p>I have tried to use a sharedInstance of the myPlugin and call MyCommand without any success.</p>
  
  <p>Any thoughts?</p>
  
  <p>Thanks</p>
  
  <p>Thanks</p>