cordova-plugin-wkwebview-engine icon indicating copy to clipboard operation
cordova-plugin-wkwebview-engine copied to clipboard

iOS 11 crash/white screen when in background

Open abroekhuis opened this issue 8 years ago • 4 comments

We are using the webview for a while already, and never had any problems. Now with the iOS11 update, we see crashes of the application, resulting in a white screen. To us it is unclear what is wrong, we already tried several things (ie, not updating the view while in background).

We do have quite active application, with a lot of (BLE) processing going on, but as mentioned, with iOS10 and older there were never any problems.

Does someone recognise this, and have any idea what is going one?

The XCode log shows the following:

017-10-02 17:31:45.878324+0200 ***[2419:356538] [ProcessSuspension] 0x1c447a040 - ProcessAssertion() Unable to acquire assertion for process with PID 0 2017-10-02 17:31:46.434234+0200 ***[2419:355854] Failed to load webpage with error: Could not connect to the server. 2017-10-02 17:31:56.067458+0200 ***[2419:355854] CDVWKWebViewEngine shouldReloadWebView:: 2017-10-02 17:31:56.067561+0200 ***[2419:355854] CDVWKWebViewEngine shouldReloadWebView title: 2017-10-02 17:31:56.067594+0200 ***[2419:355854] CDVWKWebViewEngine shouldReloadWebView location: (null) 2017-10-02 17:31:56.067629+0200 ***[2419:355854] CDVWKWebViewEngine shouldReloadWebView reload: 0 2017-10-02 17:31:56.479659+0200 ***[2419:357121] TIC Read Status [2:0x0]: 1:57 2017-10-02 17:31:56.479740+0200 ***[2419:357121] TIC Read Status [2:0x0]: 1:57

abroekhuis avatar Oct 02 '17 15:10 abroekhuis

Also wondering the same as we moved from Telerik WKWebView to this one. Wondering if it requires Ionic also, or can it be used independently?

Textras avatar Oct 17 '17 15:10 Textras

Well, for us it turned out to be a performance issue. Apparently iOS has added more/increased restrictions to the webview. We have a quite CPU intensive app, also when in the background (BLE handling), and this caused the issue. We moved the handling to a webworker, which seems to have "fixed" the issue for us.

abroekhuis avatar Oct 18 '17 11:10 abroekhuis

We moved the handling to a webworker, which seems to have "fixed" the issue for us. Hi, can you explain how you implement webworkers in the WKWebview? We have same WSOD in my hybrid app with new versions on iOS 11.

sivanov avatar Jan 17 '18 18:01 sivanov

It has been a while for me since I worked on that specific project, but since we have a webworker that does not need any interaction with plugins etc, it is just a simple webworker with no specific needs for Ionic/Cordova. So I guess any webworker guide will do. So in short, create a JS file with the code to execute in the worker, create the worker and use the onChange and postMessage methods to use it.

abroekhuis avatar Jan 17 '18 18:01 abroekhuis