Skip to content

Commit 40c8349

Browse files
authored
fix(ios): show error message when app fails to load (#382) (#383)
1 parent 2f07042 commit 40c8349

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/ios/CDVWKWebViewEngine.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -879,6 +879,11 @@ - (void)webView:(WKWebView*)theWebView didFailNavigation:(WKNavigation*)navigati
879879
NSLog(@"%@", [errorUrl absoluteString]);
880880
[theWebView loadRequest:[NSURLRequest requestWithURL:errorUrl]];
881881
}
882+
#ifdef DEBUG
883+
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"] message:message preferredStyle:UIAlertControllerStyleAlert];
884+
[alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"OK", nil) style:UIAlertActionStyleDefault handler:nil]];
885+
[vc presentViewController:alertController animated:YES completion:nil];
886+
#endif
882887
}
883888

884889
- (void)webViewWebContentProcessDidTerminate:(WKWebView *)webView

0 commit comments

Comments
 (0)