Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,9 @@ - (void)dispose
- (void) onAppWillEnterForeground:(NSNotification*)notification {
if ([self shouldReloadWebView]) {
NSLog(@"%@", @"CDVWebViewEngine reloading!");
[(WKWebView*)_engineWebView reload];
NSURL* url = [((CDVViewController*) self.viewController) appUrl];
NSURLRequest* appReq = [NSURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:20.0];
[self loadRequest:appReq];
}
}

Expand Down Expand Up @@ -562,7 +564,11 @@ - (void)webView:(WKWebView*)theWebView didFailNavigation:(WKNavigation*)navigati

- (void)webViewWebContentProcessDidTerminate:(WKWebView *)webView
{
[webView reload];
CDVViewController *vc = (CDVViewController *)self.viewController;
[vc showLaunchScreen:true];
NSURL* url = [vc appUrl];
NSURLRequest* appReq = [NSURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:20.0];
[self loadRequest:appReq];
}

- (BOOL)defaultResourcePolicyForURL:(NSURL*)url
Expand Down
4 changes: 3 additions & 1 deletion CordovaLib/include/Cordova/CDVViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,9 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, null_resettable, copy) IBInspectable UIColor *statusBarBackgroundColor;

- (UIView*)newCordovaViewWithFrame:(CGRect)bounds;

- (nullable NSString*)appURLScheme;
- (nullable NSURL*)errorURL;
- (NSURL*)appUrl;
/**
Returns the ``CDVPlugin`` instance of the given plugin name, creating the
instance if one does not exist.
Expand Down