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/05/28 02:59:33 UTC

ios commit: CB-8812 - protocol hander raises error on second firing

Repository: cordova-ios
Updated Branches:
  refs/heads/4.0.x 622ca4b26 -> bd6d86be9


CB-8812 - protocol hander raises error on second firing


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

Branch: refs/heads/4.0.x
Commit: bd6d86be9b8684b95e067ec20336ab9ba2892b35
Parents: 622ca4b
Author: Shazron Abdullah <sh...@apache.org>
Authored: Wed May 27 17:59:32 2015 -0700
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Wed May 27 17:59:32 2015 -0700

----------------------------------------------------------------------
 .../CDVUIWebViewEngine/CDVUIWebViewNavigationDelegate.m      | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/bd6d86be/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewNavigationDelegate.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewNavigationDelegate.m b/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewNavigationDelegate.m
index b660638..38e8d24 100644
--- a/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewNavigationDelegate.m
+++ b/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewNavigationDelegate.m
@@ -89,6 +89,14 @@
     NSURL* url = [request URL];
     CDVViewController* vc = (CDVViewController*)self.enginePlugin.viewController;
 
+    // Push these system schemes off to the system, and do not let the UIWebView handle them
+    if ([request.URL.scheme isEqualToString:@"maps"] ||
+        [request.URL.scheme isEqualToString:@"tel"] ||
+        [request.URL.scheme isEqualToString:@"telprompt"]) {
+        [[UIApplication sharedApplication] openURL:url];
+        return NO;
+    }
+
     /*
      * Execute any commands queued with cordova.exec() on the JS side.
      * The part of the URL after gap:// is irrelevant.


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org