Skip to content

Commit cb1f026

Browse files
authored
fix(ios): show error message when app fails to load (#382)
1 parent ffcbfb9 commit cb1f026

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
@@ -692,6 +692,11 @@ - (void)webView:(WKWebView*)theWebView didFailNavigation:(WKNavigation*)navigati
692692
NSLog(@"%@", [errorUrl absoluteString]);
693693
[theWebView loadRequest:[NSURLRequest requestWithURL:errorUrl]];
694694
}
695+
#ifdef DEBUG
696+
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"] message:message preferredStyle:UIAlertControllerStyleAlert];
697+
[alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"OK", nil) style:UIAlertActionStyleDefault handler:nil]];
698+
[vc presentViewController:alertController animated:YES completion:nil];
699+
#endif
695700
}
696701

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

0 commit comments

Comments
 (0)