CB-8556 - fix handleOpenURL for WKWebViewEngine plugin

Project: 
http://git-wip-us.apache.org/repos/asf/cordova-plugin-wkwebview-engine/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/cordova-plugin-wkwebview-engine/commit/dd69873c
Tree: 
http://git-wip-us.apache.org/repos/asf/cordova-plugin-wkwebview-engine/tree/dd69873c
Diff: 
http://git-wip-us.apache.org/repos/asf/cordova-plugin-wkwebview-engine/diff/dd69873c

Branch: refs/heads/master
Commit: dd69873c9de3f7fa1ee411602fe54cd2063b2545
Parents: 8892179
Author: Shazron Abdullah <shaz...@apache.org>
Authored: Fri Mar 13 17:18:43 2015 -0700
Committer: Shazron Abdullah <shaz...@apache.org>
Committed: Fri Mar 13 17:18:43 2015 -0700

----------------------------------------------------------------------
 src/ios/CDVWKWebViewEngine.h | 2 +-
 src/ios/CDVWKWebViewEngine.m | 9 +++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-wkwebview-engine/blob/dd69873c/src/ios/CDVWKWebViewEngine.h
----------------------------------------------------------------------
diff --git a/src/ios/CDVWKWebViewEngine.h b/src/ios/CDVWKWebViewEngine.h
index 753a07f..2fe4bc2 100644
--- a/src/ios/CDVWKWebViewEngine.h
+++ b/src/ios/CDVWKWebViewEngine.h
@@ -20,7 +20,7 @@
 #import <WebKit/WebKit.h>
 #import <Cordova/CDV.h>
 
-@interface CDVWKWebViewEngine : CDVPlugin <CDVWebViewEngineProtocol, 
WKScriptMessageHandler>
+@interface CDVWKWebViewEngine : CDVPlugin <CDVWebViewEngineProtocol, 
WKScriptMessageHandler, WKNavigationDelegate>
 
 @property (nonatomic, strong, readonly) id <WKUIDelegate> uiDelegate;
 

http://git-wip-us.apache.org/repos/asf/cordova-plugin-wkwebview-engine/blob/dd69873c/src/ios/CDVWKWebViewEngine.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVWKWebViewEngine.m b/src/ios/CDVWKWebViewEngine.m
index c19d7e2..63218ba 100644
--- a/src/ios/CDVWKWebViewEngine.m
+++ b/src/ios/CDVWKWebViewEngine.m
@@ -78,6 +78,8 @@
 
     if ([self.viewController 
conformsToProtocol:@protocol(WKNavigationDelegate)]) {
         wkWebView.navigationDelegate = (id 
<WKNavigationDelegate>)self.viewController;
+    } else {
+        wkWebView.navigationDelegate = (id <WKNavigationDelegate>)self;
     }
 
     if ([self.viewController 
conformsToProtocol:@protocol(WKScriptMessageHandler)]) {
@@ -193,4 +195,11 @@
     }
 }
 
+#pragma mark WKNavigationDelegate implementation
+
+- (void)webView:(WKWebView*)webView 
didFinishNavigation:(WKNavigation*)navigation
+{
+    [[NSNotificationCenter defaultCenter] postNotification:[NSNotification 
notificationWithName:CDVPageDidLoadNotification object:webView]];
+}
+
 @end


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org

Reply via email to