Cordova iOS App shows header and footer but blank white content When App put to background and foreground again the Blank white content shows up

Viewed 73

There is an issue I am facing with building an iOS Cordova app.

Firstly, Versions

cordova: 8.1.2
cordova-ios: 4.5.5(not allowed to upgrade this)

The app builds using the cordova terminal commands

when I open the generated Xcode project(in Xcode 12) and run the project from there I get following error:

ERROR Internal navigation rejected - <allow-navigation> not set for url='gap://ready'

I tried fixing this by doing in my config.xml I tried adding meta tags allowing gap://ready in index.html but in both cases, I got following error:

[Process] 0x7ff5e401b820 - [pageProxyID=20, webPageID=21, PID=4458] WebPageProxy::didFailProvisionalLoadForFrame: frameID = 15, domain = NSURLErrorDomain, code = -1002

basically I got NSURLErrorUnsupportedURL.

So I removed the change and got back to previous error of gap://ready

I used Safari Web Inspector and added a breakpoint in the cordova.js file where gap://ready was being set as a url to hit in the app.

  // Check if they've removed it from the DOM, and put it back if so.
    if (execIframe && execIframe.contentWindow) {
        execIframe.contentWindow.location = 'gap://ready';
    } else {
        execIframe = document.createElement('iframe');
        execIframe.style.display = 'none';
        execIframe.src = 'gap://ready';
        document.body.appendChild(execIframe);
    }

The above snippet code was running continuously and my app was not accepting gap://ready as url. Meanwhile I just put the app to background and back to foreground again the blank content issue was fixed. But wait, So It some links and buttons. I tapped on one of those, nothing happened. I put the app again in background and then in foreground a second after that, the pressed button action was called. Similarly, any action I wanted to perform in the app the same background/foreground switching was working.

Now I have read about WKWebView not supporting iframes(https://cordova.apache.org/news/2018/08/01/future-cordova-ios-webview.html)

Could this be the issue here?

Additionally, I played with cordova.js code as well. Commented it, not let it execute and stuff like that but no luck.

I have been trying to get this working since 2 days now but no luck. Any help is appreciated. Please let me know what your thoughts are.

Thanks in advance.

0 Answers
Related