Cordova iOS White Screen Bug – Fix & Upstreaming Advice?

Issue:
White screen on iOS Cordova app when returning from background after memory pressure (App becomes frozen and unresponsive).


DESCRIPTION:
I’m encountering a white screen issue on iOS when using a Meteor + Cordova mobile app. Specifically, if the Cordova app is backgrounded and another memory-intensive app is launched, returning to the Cordova app results in a frozen white screen. There’s no recovery mechanism, and the user is forced to kill and restart the app.


STEPS TO REPRODUCE:

  1. Launch the Cordova app on an iOS device.
  2. Background the app.
  3. Open a memory-intensive app (e.g., Camera, Photos).
  4. Wait or interact with the memory-heavy app.
  5. Return to the Cordova app.
  6. Observe: the app shows a white screen and is completely unresponsive.

CURRENT BEHAVIOR:

  • White screen shown upon returning
  • App frozen with no navigation or reload
  • Must kill and relaunch the app manually

EXPECTED BEHAVIOR:

  • App should reload automatically
  • No white screen or freeze
  • App remains usable after memory pressure event

ROOT CAUSE:
iOS can kill backgrounded apps during memory pressure. When this happens, the Cordova WebView doesn’t properly reload upon restoration, leading to the white screen.

FIX IMPLEMENTED:
I applied the fix from apache/cordova-ios#1552, which modifies CDVWebViewEngine.m to also check for the title as “” along with the null and try to reload the app URL with cache-busting logic. This works as expected and prevents the white screen issue.

Our fix is a hack becuase our app always has a title. If there are pages without titles it could be a less than ideal fix:

BOOL title_is_nil = (title == nil) || [title isEqualToString:@""];

Modified CDVWebViewEngine.m : Updated the onAppWillEnterForeground: method to reload the app URL with cache disabled instead of just calling reload() :

// PATCH FOR WHITE SCREEN OF DEATH:
// Instead of just calling reload, we need to reload the app URL with cache disabled
NSURL* url = [((CDVViewController*) self.viewController) appUrl];
NSURLRequest* appReq = [NSURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:20.0];
[((WKWebView*)_engineWebView) loadRequest:appReq];

I placed the modified files inside cordova-build-override/platforms/ios/CordovaLib as per Meteor’s override mechanism, and verified that it works across multiple iOS devices and memory conditions.


QUESTION:
Meteor 3.3 currently uses cordova-ios version 7.1.1, and that’s the version I patched. I’d like to create a PR upstream to the Apache Cordova project with this fix.

My main question is:

What’s the right way to proceed?
Should I create a PR targeting the Cordova master branch or patch the 7.1.1 tag/branch (if that’s what Meteor will use for some time)? Will future Meteor versions eventually use Cordova master or later Cordova iOS releases?

Any guidance from the Meteor team on how Cordova updates are managed in Meteor, and whether I should coordinate the fix through Meteor or directly with the Cordova maintainers, would be very helpful.

1 Like

Ideally, we should wait for the next cordova-ios version with that fix included, then bundle the Meteor tool again and release the corresponding new Meteor release.

However, if this is a critical fix affecting many Cordova iOS development scenarios, we could make an exception and use a custom branch linked to it. We currently have our own fork of meteor/cordova-ios, which we only use for branches with patches in Meteor 2.x. When cordova-ios includes the fix in an official release, we can update to that version and stop using the forked version.

So, is this issue happening on the latest iOS versions with any Meteor iOS app? Is it common and critical? Is the fix completely verified? We can likely use the forked version including the fix for the next Meteor 3.3.2 release.

Let us know.

Is this issue happening on the latest iOS versions with any Meteor iOS app?
Yes — this issue occurs consistently on the latest iOS versions across all Meteor iOS apps. We’ve reproduced it even in a fresh Meteor project.

Is it common and critical?
Yes — it’s both common and critical, affecting a wide range of iOS apps. Many users are experiencing the same problem.

Relevant links:

  1. White screen of death when reopening iOS Cordova app
  2. Fix #1232: Reload issue resulting in white screen
  3. Cordova app white screen of death

Is the fix completely verified?
Yes — we’ve tested the fix extensively and confirmed it works. We’ve also submitted a PR to Apache Cordova:
White Screen of Death issue | Enhance WebView reload detection to handle empty title strings

You can also see a recorded example of the issue in action:
Captured the White Screen of Death in the debugger

1 Like