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 2014/11/01 00:43:28 UTC

[08/50] ios commit: CB-7777 - In AppDelegate, before calling handleOpenURL check whether it exists first to prevent exceptions (closes #109)

CB-7777 - In AppDelegate, before calling handleOpenURL check whether it exists first to prevent exceptions (closes #109)

Signed-off-by: Shazron Abdullah <sh...@apache.org>


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

Branch: refs/heads/wkwebview
Commit: b1ebdab272c64b69ad434a7c72abd05fd660ac71
Parents: 875f5a4
Author: Emil Marashliev <em...@me.com>
Authored: Mon Sep 29 15:24:14 2014 +0300
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Mon Oct 13 13:56:32 2014 -0700

----------------------------------------------------------------------
 bin/templates/project/__PROJECT_NAME__/Classes/AppDelegate.m | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/b1ebdab2/bin/templates/project/__PROJECT_NAME__/Classes/AppDelegate.m
----------------------------------------------------------------------
diff --git a/bin/templates/project/__PROJECT_NAME__/Classes/AppDelegate.m b/bin/templates/project/__PROJECT_NAME__/Classes/AppDelegate.m
index cc82260..1cf7fb6 100644
--- a/bin/templates/project/__PROJECT_NAME__/Classes/AppDelegate.m
+++ b/bin/templates/project/__PROJECT_NAME__/Classes/AppDelegate.m
@@ -100,7 +100,7 @@
     }
 
     // calls into javascript global function 'handleOpenURL'
-    NSString* jsString = [NSString stringWithFormat:@"handleOpenURL(\"%@\");", url];
+    NSString* jsString = [NSString stringWithFormat:@"if (typeof handleOpenURL === 'function') { handleOpenURL(\"%@\");}", url];
     [self.viewController.webView stringByEvaluatingJavaScriptFromString:jsString];
 
     // all plugins will get the notification, and their handlers will be called


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