title: Cordova 4.4.0 call iOS Objective-C native method not working
body: <p>Update:
  Now the JavaScript is able to call my Objective C plugin code after event "deviceReady".
  BUT
  It only works when I push the app to the background, otherwise, it just hang there and never call my plugin code. 
  I can see the console says when the plugin is called</p>
  
  <pre><code>[29277:15212897] THREAD WARNING: ['HybridBridge'] took '9252.614014' ms. Plugin should use a background thread.
  </code></pre>
  
  <p>I understand the warning "'9252.614014' ms" is caused by my manual action that push the app to the background</p>
  
  <p>But WHY??? Why my Objective C plugin code is only called when the app goes to the background?</p>
  
  <hr>
  
  <p>I am creating a Cordova 4.4.0 plugin for my objective C based iOS app
  The JavaScript is trigged successfully, however, javascript code:</p>
  
  <pre><code>cordova.exec(saySuccess, sayFailure, PLUGIN_NAME, METHOD_NAME, [page]);
  </code></pre>
  
  <p>It just won't trigger my Objective C code</p>
  
  <p>Objective C method is not called at all</p>
  
  <p>The plugin has been registered in config.xml as the following</p>
  
  <pre><code>    &lt;feature name="HybridBridge"&gt;
          &lt;param name="ios-package" value="HybridBridge"/&gt;
          &lt;param name="onload" value="true" /&gt;
      &lt;/feature&gt;
  </code></pre>
  
  <p>At the following is my code, please help.</p>
  
  <p>JavaScript code that calls Objective C method:</p>
  
  <pre><code>var hybridBridge = (function() {
  
      var PLUGIN_NAME = "HybridBridge";
      var METHOD_NAME = "loadExternalPage";
  
      this.loadExternalPage = function (page) {
          cordova.exec(saySuccess, sayFailure, PLUGIN_NAME, METHOD_NAME, [page]);
      };
      return this;
  }());
  function saySuccess() {
      alert("Success");
  }
  
  function sayFailure () {
      alert ("Failure");
  }
  </code></pre>
  
  <p>Config.xml file:</p>
  
  <pre><code>&lt;widget&gt;
      &lt;!-- Whitelist docs: https://github.com/apache/cordova-plugin-whitelist --&gt;
      &lt;access origin="*" /&gt;
      &lt;!-- Grant certain URLs the ability to launch external applications. This
           behaviour is set to match that of Cordova versions before 3.6.0, and
           should be reviewed before launching an application in production. It
           may be changed in the future. --&gt;
      &lt;allow-intent href="http://*/*" /&gt;
      &lt;allow-intent href="https://*/*" /&gt;
      &lt;allow-intent href="tel:*" /&gt;
      &lt;allow-intent href="sms:*" /&gt;
      &lt;allow-intent href="mailto:*" /&gt;
      &lt;allow-intent href="geo:*" /&gt;
      &lt;allow-intent href="itms:*" /&gt;
      &lt;allow-intent href="itms-apps:*" /&gt;
  
      &lt;!-- Preferences for iOS --&gt;
      &lt;preference name="AllowInlineMediaPlayback" value="false" /&gt;
      &lt;preference name="BackupWebStorage" value="cloud" /&gt;
      &lt;preference name="DisallowOverscroll" value="false" /&gt;
      &lt;preference name="EnableViewportScale" value="false" /&gt;
      &lt;preference name="KeyboardDisplayRequiresUserAction" value="true" /&gt;
      &lt;preference name="MediaPlaybackRequiresUserAction" value="false" /&gt;
      &lt;preference name="SuppressesIncrementalRendering" value="false" /&gt;
      &lt;preference name="SuppressesLongPressGesture" value="false" /&gt;
      &lt;preference name="Suppresses3DTouchGesture" value="false" /&gt;
      &lt;preference name="GapBetweenPages" value="0" /&gt;
      &lt;preference name="PageLength" value="0" /&gt;
      &lt;preference name="PaginationBreakingMode" value="page" /&gt; &lt;!-- page, column --&gt;
      &lt;preference name="PaginationMode" value="unpaginated" /&gt; &lt;!-- unpaginated, leftToRight, topToBottom, bottomToTop, rightToLeft --&gt;
  
      &lt;feature name="LocalStorage"&gt;
          &lt;param name="ios-package" value="CDVLocalStorage"/&gt;
      &lt;/feature&gt;
      &lt;feature name="HandleOpenUrl"&gt;
          &lt;param name="ios-package" value="CDVHandleOpenURL"/&gt;
          &lt;param name="onload" value="true"/&gt;
      &lt;/feature&gt;
      &lt;feature name="IntentAndNavigationFilter"&gt;
          &lt;param name="ios-package" value="CDVIntentAndNavigationFilter"/&gt;
          &lt;param name="onload" value="true"/&gt;
      &lt;/feature&gt;
      &lt;feature name="GestureHandler"&gt;
          &lt;param name="ios-package" value="CDVGestureHandler"/&gt;
          &lt;param name="onload" value="true"/&gt;
      &lt;/feature&gt;
      &lt;feature name="HybridBridge"&gt;
          &lt;param name="ios-package" value="HybridBridge"/&gt;
          &lt;param name="onload" value="true" /&gt;
      &lt;/feature&gt;
  &lt;/widget&gt;
  </code></pre>
  
  <p>Objective C code for plugin</p>
  
  <pre><code>#import "HybridBridge.h"
  
  @implementation HybridBridge
  
  -(void) loadExternalPage:(CDVInvokedUrlCommand*) command {
      NSLog(@"init");
      NSString *page = [command.arguments objectAtIndex:0];
      NSString *webPage =[NSString stringWithFormat:@"%@%@", [CommonUtil readInfoPlist:@"host"], page];
      CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:webPage];
      [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
  }
  @end
  </code></pre>
  
  <p>I really don't know why my plugin method "loadExternalPage" is not called in Objective-C. Please help.</p>