Wednesday, December 4, 2013

Cordova ios webview debug issue

Cordova is a great open source framework. But it is free, which means you cannot expect too much from it. The following are two ios debug issues to make it work properly

1. To avoid webview thread lock crash:

In cordova.js, find method iOSExec.nativeCallback at line 1009, and replace it with the following code

iOSExec.nativeCallback = function(callbackId, status, message, keepCallback) {
    function f0(){
       return iOSExec.nativeEvalAndFetch(function() {
          var success = status === 0 || status === 1;
          var args = convertMessageToArgsNativeToJs(message);
          cordova.callbackFromNative(callbackId, success, status, args, keepCallback);
       });
    }
    setTimeout(f0, 100);

};

2. To avoid missing plugin call
In cordova.js line 949, change it to following
    if (true || !isInContextOfEvalJs && commandQueue.length == 1) {
        if (bridgeMode != jsToNativeModes.IFRAME_NAV) {
            // This prevents sending an XHR when there is already one being sent.
            // This should happen only in rare circumstances (refer to unit tests).
            if (execXhr && execXhr.readyState != 4) {
                execXhr = null;

            }

2 comments:

  1. This is quite a good blog.Are you also searching for BSN Writing Services. we are the best solution for you. We are best known for delivering nursing writing services to students without having to break the bank.

    ReplyDelete
  2. I want to always read your blogs. I love them Are you also searching for nursing dissertation writing help? we are the best solution for you. We are best known for delivering Nursing dissertation writing services to students without having to break the bank

    ReplyDelete