You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sh...@apache.org on 2015/03/14 01:18:41 UTC

cordova-plugins git commit: CB-8556 - fix handleOpenURL for WKWebViewEngine plugin

Repository: cordova-plugins
Updated Branches:
  refs/heads/master 0ccc653ae -> 5d5588f69


CB-8556 - fix handleOpenURL for WKWebViewEngine plugin


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugins/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugins/commit/5d5588f6
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugins/tree/5d5588f6
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugins/diff/5d5588f6

Branch: refs/heads/master
Commit: 5d5588f6926b0aca994ba97935a01e2c89bce855
Parents: 0ccc653
Author: Shazron Abdullah <sh...@apache.org>
Authored: Fri Mar 13 17:18:43 2015 -0700
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Fri Mar 13 17:18:43 2015 -0700

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


http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/5d5588f6/wkwebview-engine/src/ios/CDVWKWebViewEngine.h
----------------------------------------------------------------------
diff --git a/wkwebview-engine/src/ios/CDVWKWebViewEngine.h b/wkwebview-engine/src/ios/CDVWKWebViewEngine.h
index 753a07f..2fe4bc2 100644
--- a/wkwebview-engine/src/ios/CDVWKWebViewEngine.h
+++ b/wkwebview-engine/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-plugins/blob/5d5588f6/wkwebview-engine/src/ios/CDVWKWebViewEngine.m
----------------------------------------------------------------------
diff --git a/wkwebview-engine/src/ios/CDVWKWebViewEngine.m b/wkwebview-engine/src/ios/CDVWKWebViewEngine.m
index c19d7e2..63218ba 100644
--- a/wkwebview-engine/src/ios/CDVWKWebViewEngine.m
+++ b/wkwebview-engine/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: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org