gouteru commented on issue #1232:
URL: https://github.com/apache/cordova-ios/issues/1232#issuecomment-1112266641

   I think I found the root cause.
   The root cause was wkwebview.URL when webViewWebContentProcessDidTerminate 
was called.
   When I terminated "com.apple.WebKit.WebContent" process,  
webViewWebContentProcessDidTerminate was called but the reload url was 
incorrect as "app://localhost/index.html#/AppView". The url indicates one of my 
Vue JS component (the url is the one when app get into background) but not the 
initial url. 
   Due to my app is based on Cordova and Vue framework and initial entry file 
should be "app://localhost/index.html".
   Then I modified 
ios/CordovaLib/Classes/Private/Plugins/CDVWebviewEngine/CDVWebviewEngine.m file 
as follows.
   The change worked fine. I could reproduced 100% of white screen issue with 
the above mentioned procedures however with the code change below I cannot 
reproduce the white screen issue.
   Since I am not familiar with ObjectiveC and CordovaLib fashion, please 
someone review the code below and let me know if it's okay or there is better 
code.
   
   ```
   - (void)webViewWebContentProcessDidTerminate:(WKWebView *)webView
   {
       NSLog(@"webViewWebContentProcessDidTerminate  wevView reload:");
       NSString *sURL = @"app://localhost/index.html";
       NSURL *url = [NSURL URLWithString:sURL];
       NSLog(@"webViewWebContentProcessDidTerminate  url: %@", [url 
absoluteString]);
       NSLog(@"webViewWebContentProcessDidTerminate  wevView.url: %@", 
[webView.URL absoluteString]);
       [webView loadRequest:[NSURLRequest requestWithURL:url]];
       // [webView reload];
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to