From 24068a10e40214afdf40ed99dd8ab356f00d30e6 Mon Sep 17 00:00:00 2001 From: jcesarmobile Date: Tue, 25 Jun 2019 19:07:40 +0200 Subject: [PATCH] fix(ios): show error message when app fails to load --- src/ios/CDVWKWebViewEngine.m | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ios/CDVWKWebViewEngine.m b/src/ios/CDVWKWebViewEngine.m index 2f5e4ede..b976beca 100644 --- a/src/ios/CDVWKWebViewEngine.m +++ b/src/ios/CDVWKWebViewEngine.m @@ -692,6 +692,11 @@ - (void)webView:(WKWebView*)theWebView didFailNavigation:(WKNavigation*)navigati NSLog(@"%@", [errorUrl absoluteString]); [theWebView loadRequest:[NSURLRequest requestWithURL:errorUrl]]; } +#ifdef DEBUG + UIAlertController *alertController = [UIAlertController alertControllerWithTitle:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"] message:message preferredStyle:UIAlertControllerStyleAlert]; + [alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"OK", nil) style:UIAlertActionStyleDefault handler:nil]]; + [vc presentViewController:alertController animated:YES completion:nil]; +#endif } - (void)webViewWebContentProcessDidTerminate:(WKWebView *)webView