scripts/webviewbridge.js
function (message) {
      receiveQueue.push(message);
      //reason I need this setTmeout is to return this function as fast as
      //possible to release the native side thread.
      setTimeout(function () {
        var message = receiveQueue.pop();
        callFunc(WebViewBridge.onMessage, message);
      }, 15); //this magic number is just a random small value. I don't like 0.
    }
function (message) {
      receiveQueue.push(message);
      //reason I need this setTmeout is to return this function as fast as
      //possible to release the native side thread.
      setTimeout(function () {
        var message = receiveQueue.pop();
        callFunc(WebViewBridge.onMessage, message);
      }, 15); //this magic number is just a random small value. I don't like 0.
    }
function ( message ) { receiveQueue . push ( message ) ; //reason I need this setTmeout is to return this function as fast as //possible to release the native side thread. setTimeout ( function ( ) { var message = receiveQueue . pop ( ) ; callFunc ( WebViewBridge . onMessage , message ) ; } , 15 ) ; //this magic number is just a random small value. I don't like 0. }
this function will be called by native side to push a new message to webview.
this function will be called by native side to push a new message to webview .