meteor / cordova-plugin-meteor-webapp

Cordova plugin that serves a Meteor web app through a local server and implements hot code push
MIT License
66 stars 74 forks source link

Webapp Forced Reload blank page #94

Open Nauzer opened 4 years ago

Nauzer commented 4 years ago

Sometimes on iOS the WKWebView is forced to reload because of the following code:

From cordova-plugin-wkwebview-engine src/ios/CDVWKWebViewEngine.m

- (void)webViewWebContentProcessDidTerminate:(WKWebView *)webView
{
    [webView reload];
}

This causes the WebView to reload but in combination with cordova-plugin-meteor-webapp it causes the WebView to show a white / blank screen which is in fact an empty index.html with empty and tags.

Willing to make a PR if someone could maybe give some clues on where to start and how to handle this scenario and handle the reload gracefully here. I'm not a Native guru ;-) Would it perhaps be possible to handle webViewWebContentProcessDidTerminate method directly in this plugin?

For me it seems to be triggered by OOM scenarios when taking & uploading photos in our app. Specifically when returning from Camera view after picking a picture (using cordova-plugin-camera).