From 2934d0835d0fc919704a827fd57afab472969077 Mon Sep 17 00:00:00 2001 From: Jeff Chang Date: Wed, 6 Mar 2019 10:25:03 -0800 Subject: [PATCH] UIWebView call loadRequest multiple times lead to deadlock in iOS12 Detail Explanation * Forces iOS 12 to fire callback in webViewDidFinish to disable the splash screen and load the webview for the app. * Fix ported from: https://github.com/apache/cordova-ios/pull/450 --- .../Plugins/CDVUIWebViewEngine/CDVUIWebViewDelegate.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewDelegate.m b/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewDelegate.m index 676912171..8230d6f3a 100644 --- a/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewDelegate.m +++ b/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewDelegate.m @@ -329,9 +329,13 @@ - (void)webViewDidFinishLoad:(UIWebView*)webView break; case STATE_WAITING_FOR_LOAD_FINISH: - if (_loadCount == 1) { + if (@available(iOS 12.0, *)){ fireCallback = YES; - _state = STATE_IDLE; + } else { + if (_loadCount == 1) { + fireCallback = YES; + _state = STATE_IDLE; + } } _loadCount -= 1; break;