scripts/webviewbridge.js
function (message) {
      if ('string' !== typeof message) {
        callFunc(WebViewBridge.onError, "message is type '" + typeof message + "', and it needs to be string");
        return;
      }

      //we queue the messages to make sure that native can collects all of them in one shot.
      sendQueue.push(message);
      //signal the objective-c that there is a message in the queue
      signalNative();
    }
function (message) {
      if ('string' !== typeof message) {
        callFunc(WebViewBridge.onError, "message is type '" + typeof message + "', and it needs to be string");
        return;
      }

      //we queue the messages to make sure that native can collects all of them in one shot.
      sendQueue.push(message);
      //signal the objective-c that there is a message in the queue
      signalNative();
    }
function ( message ) { if ( 'string' !== typeof message ) { callFunc ( WebViewBridge . onError , "message is type '" + typeof message + "', and it needs to be string" ) ; return ; } //we queue the messages to make sure that native can collects all of them in one shot. sendQueue . push ( message ) ; //signal the objective-c that there is a message in the queue signalNative ( ) ; }
make sure message is string. because only string can be sent to native, if you don't pass it as string, onError function will be called.
make sure message is string . because only string can be sent to native if you don t pass it as string onError function will be called .