How to handle WKWebView Errors after ios memory pressure ? #5260
Replies: 4 comments 2 replies
-
Same issue, do you have any solution. |
Beta Was this translation helpful? Give feedback.
-
Having the same issue, and found the |
Beta Was this translation helpful? Give feedback.
-
FYI, as mentioned here and referred to here, Capacitor 3.4.1 adds back the code that reloads the WebView if it's been terminated. This still results in the white screen during the reload with no splash screen though. I think that's because the WKWebView is running as a separate process, and it's the overall native app process (the "shell") that triggers the splash screen to appear when it starts up. If, for example, the entire native app process (not just the WKWebView) is killed while being backgrounded, then after bringing the app to the foreground the splash screen would likely appear again. This issue, which I linked to above, is about a feature request to notify the JS layer about a WebView reload. While you might be able to use JS to show the splash screen again, it very likely wouldn't be early enough to prevent some of the white screen from showing since the reload would by necessity occur before the JS could even load. I would think something like that may have to be handled in native code before the call to the WebView reload occurs. I might reply to the issue about what we're doing in our app. We're customizing Capacitor code where |
Beta Was this translation helpful? Give feedback.
-
Same issue, do you have any solution. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
After some time in background and under memory pressure from other apps in ios i get following errors (Gathered during app debug in XCode):
Is it possible somehow to handle it and make some required actions? For example, show splash screen again, before app actually will be reloaded ?
Why app in this case not fully reloaded, but reloaded only content in WKWebview ?
Currently, after that kind of situation, i see white screen for a while (like 'new tab' in a safari) before actual re-load of my app. Is there is any option to show default splash screen during that kind of situations?
Beta Was this translation helpful? Give feedback.
All reactions