-
Notifications
You must be signed in to change notification settings - Fork 990
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
My app stops white blank screen when app back to foreground from background #1232
Comments
Here's info I found about WKwebview process. Please help! |
I have a similar issue. Maybe remove all plugins and add one by one again or clean build in Xcode (Product > Clean Build Folder). But for me it did not work. edit: edit 2: |
I think your issue is probably different from mine. |
I could solve mine. |
Any update on this? Can't detect an error like "Could not signal service com.apple.WebKit.WebContent: 113: Could not find specified service"? And if it can be detected, is there any way to reload webview again or restore communication with the WebContent process? |
I think I found the root cause.
|
Here's additional changes below.
I think shouldReloadWebView's title check is insufficient. In my app's case when WebContent process is terminated, title is not nil but empty string. So, empty string check should be added. With this change, when WebContent process is terminated while my app is in background, and then back in foreground, 2 functions "onAppWillEnterForeground" and "webViewWebContentProcessDidTerminate" do loadRequest. As long as my test, 2 times of loadRequest is not making any issue. |
I think many of Cordova users will use additional JS frameworks such as Vue or React. So the url issue when WebContet process is terminated by iOS, is critical. When WebContent process is terminated, everything of JS code and state is cleared from memory. In that case, WebContent should load with index.html because app should go through its initialization to initialize Cordova plugins or firebase, etc. But currently, the url is as-is when app switched into background. |
Thanks @gouteru for your patch; I‘m running into similar issues with Cordova and meteor 2.7.1. Applied your patch, with no success. Still WSOD. Meteor determines the port number for localhost based on App ID or something, in order to avoid conflicting ports with other apps. Does your patch take care of ports? PS: Will try your method to reproduce the issue, which was not really possible before … |
Sorry, I have no idea about ports. |
@bratelefant see my comment in meteor/meteor#11811 (comment), maybe this fixes it? |
@JH7 Just read your post, sounds reasonable for me. Will give it a shot and come back later. What I did until now: Followed @gouteru 's instructions to reload the initial app url; didn't work at first try, due to "allow-navigation" errors, since the url didn't fit the scheme from cordovas config.xml. So i exchanged the url in the patch by During testing I can confirm that the following method let's your quite easily reproduce the issue:
Apples "Instuments" app turns out to be quite helpful in monitoring, just learned that it existed... ;) |
hello, i having an similar issue with ios cordova , ios app in simulator works fine, when i try to acess url call its shows nothing just white screen |
I currently use a patchfile in my CI chain as follows: src-cordova/fix-ios-black-screen.patch
Somewhere in the CI chain (release_ios.sh)
|
i think i have the same issue as you had, can you help out with the issue |
Bug Report
Many of my app users has been reporting the issue that my app stops as white screen when it back to foreground from background.
Problem
What is expected to happen?
When back to foreground, app should display its webview contents properly.
What does actually happen?
When back to foreground, app displays white blank screen and no way to control by user(it looks freezing).
Information
I have been researching the issue a couple of months because I haven't reproduced.
Finally I could reproduce the issue by killing 2 webview processes with Acitivity Monitor of MacOS.
Here’s the procedure.
When the app is back to foreground, app shows white screen but the killed 2 processes are reloaded in Activity Monitor view. But those 2 processes seem never communicate with app main process properly.
I guess, cordova-ios detects that webview processes are terminated and do webview.reload() but after that the reloaded processes are not communicating with app main process. Then my Javascript code is not loaded, not working, not rendering anything, so I can do nothing.
Here’s the log of Xcode.
Environment, Platform, Device
Various of iPhone hardware and iOS versions has been reported from my app users.
Version information
Checklist
[x] I searched for existing GitHub issues
[x] I updated all Cordova tooling to most recent version
[x] I included all the necessary information above
The text was updated successfully, but these errors were encountered: