Skip to content
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

White Screen with WKSuspendInBackground set to false #189

Closed
write2sv opened this issue Oct 9, 2018 · 19 comments
Closed

White Screen with WKSuspendInBackground set to false #189

write2sv opened this issue Oct 9, 2018 · 19 comments

Comments

@write2sv
Copy link

write2sv commented Oct 9, 2018

In short, the app is showing a white overlay when brought to foreground from background.

Our users are complaining about seeing the app in all white. The below steps are the only way I was able to recreate the issue. Please note that users observed this issue even without opening any external window from app as suggested in the below steps. These steps are to easily recreate the issue so that we can think of a fix.

Steps to recreate:

  1. Launch the app
  2. Open any external window from app. For eg: inAppbrowser or open a pdf using documentViewer/file2 plugins
  3. Put the app in background
  4. Wait for iOS to send a suspend signal
  5. Relaunch the app. Up on dismissing the external window (for example clicking on Done button) you will see the white overlay screen on the app.

Exact recreation steps in a Video: (The phone you are seeing on the left in this video is a real device)
You can skip the video from 30 seconds to 3 minutes to save some of your valuable time :)
https://youtu.be/gryhObPDDfA
At the end of the Video observe how Chrome inspect can actually see the screen and all the html entities are in place!

Here is a sample git repository that is helpful: (This is ionic tabs starter + cordova documentViewer, fileTransfer plugins + WKSuspendInBackground set to false)
https://github.com/write2sv/whitescreen_issue_ionic

My Ionic Info:
Ionic:

ionic (Ionic CLI) : 4.1.2 (/usr/local/lib/node_modules/ionic)
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.2.0

Cordova:

cordova (Cordova CLI) : 8.1.1 (cordova-lib@8.1.0)
Cordova Platforms : ios 4.5.5
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.2.0, (and 7 otherplugins)

System:

Android SDK Tools : 26.1.1 (/Users/shaggy/Library/Android/sdk)
ios-deploy : 1.9.2
ios-sim : 5.0.13
NodeJS : v8.4.0 (/usr/local/bin/node)
npm : 3.10.8
OS : macOS High Sierra
Xcode : Xcode 9.4.1 Build version 9F2000

I hope some one can help me figure out where the issue is.

@ghenry22
Copy link
Contributor

ghenry22 commented Oct 10, 2018

out of curiosity if you close the external window before sending the app to the background does the problem still occur?

A work around maybe to close any open external viewers in the lifecycle event that is triggered when the app is sent to the background. You could always open them again in the lifecycle event when app is brought back to foreground.

@write2sv
Copy link
Author

write2sv commented Oct 10, 2018 via email

@ghenry22
Copy link
Contributor

@write2sv out of interest are you using any code push plugins for updating that app? I think there are currently some known issues with some of the code push plugins under certain scenarios that will also result in a white screen and am curious if this is related.

@write2sv
Copy link
Author

write2sv commented Oct 12, 2018 via email

@gregavola
Copy link

We see this all the time, how can we prevent the WkWebview from being suspended in the background? This doesn't happen with other apps...

@T3chTobi
Copy link

T3chTobi commented Feb 4, 2019

Any news here? I'm experiencing the same issue...

@giladrom
Copy link

Same here... works great on iOS 12.1 but broken on 12.2.

@factionfour
Copy link

Same here. Anyone?

@giladrom
Copy link

Don't know about you guys, but I can't afford my application to break for hundreds of users the day iOS 12.2 hits GA. I've abandoned Ionic/Cordova and am rewriting my entire app using Swift.

@T3chTobi
Copy link

I guess that's not an option for 99,9 % of the plugin users

@giladrom
Copy link

FYI this is because the plugin used a private API to facilitate background operation, which Apple finally disabled - so will probably not get fixed. The alternative is having a non-functional application.

@factionfour
Copy link

So do we abandon the wkWebView plugin? Isn’t the UIWebview deprecated in iOS 12?

@giladrom
Copy link

giladrom commented Feb 20, 2019

I can't see a path forward, at least for me:

This plugin is broken - and any other method of running in the background using Ionic 3 is broken as well since the API isn't available anymore, so Ionic 3 simply doesn't work for me once 12.2 hits.

I'm left with two options:

  1. Migrate to Ionic 4. There are several issues there:
  • Seems like upgrading apps with lots of dependencies and customizations takes considerable effort and incur performance penalties. In addition, no one can tell if background operation is functional with Ionic 4.

  • iBeacon plugin (maybe more? can't say) is broken on Ionic 4, and the maintainer has been MIA for months.

  1. Rewrite my application natively

Conclusion:
Migrating to Ionic 4 possibly means i'll have to fix and maintain broken Ionic plugins and quite possibly
implement background functionality into Ionic, and maintain it. And after all this work, Apple might pull another rabbit out of their hat and break that as well.

Both tasks seem equally as painful - but at least with native code I know for a fact everything will work, and continue working.

@T3chTobi
Copy link

I'm not using Ionic, I'm just using the ionic-webview plugin, is there a way for me to use the ionic 4 webview?

@T3chTobi
Copy link

does it work with plugin version 4.0.0 or is the white screen error occurring there, too?

@factionfour
Copy link

I'm not using Ionic, I'm just using the ionic-webview plugin, is there a way for me to use the ionic 4 webview?

I don't want to give up on cordova just yet (also not using ionic) - so I second the question.

@T3chTobi
Copy link

So is there a fix for iOS 12.2 with the ionic webview to prevent the white screen? (because we can't use WKSuspendInBackground anymore)

@giladrom
Copy link

See this issue: #293

Looks like there will not be a fix.

@mlynch
Copy link
Contributor

mlynch commented Feb 21, 2019

We released several fixes for this last week. Upgrade to 4.0 if you're able to drop the webserver (and iOS 10), or use the latest 2.x if you need to support iOS 10 still. Both have a fix for this issue.

This issue got lost as it's a duplicate of several others.

@mlynch mlynch closed this as completed Feb 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants