cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shaz...@apache.org
Subject ios commit: CB-11895: openURL: is deprecated on iOS 10
Date Thu, 13 Apr 2017 17:54:08 GMT
Repository: cordova-ios
Updated Branches:
  refs/heads/master 7724d9c60 -> d7f5eefdd


CB-11895: openURL: is deprecated on iOS 10

 This closes #302


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

Branch: refs/heads/master
Commit: d7f5eefdd928e9ccb107faf8e7aa25912ecded02
Parents: 7724d9c
Author: Kerri Shotts <kerrishotts@gmail.com>
Authored: Wed Apr 12 16:02:57 2017 -0500
Committer: Shazron Abdullah <shazron@gmail.com>
Committed: Thu Apr 13 10:53:57 2017 -0700

----------------------------------------------------------------------
 .../CDVIntentAndNavigationFilter.m                       | 11 +++++++++++
 1 file changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/d7f5eefd/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.m
b/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.m
index bc8f720..2b13849 100644
--- a/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.m
+++ b/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.m
@@ -118,7 +118,18 @@
             // only allow-intent if it's a UIWebViewNavigationTypeLinkClicked (anchor tag)
OR
             // it's a UIWebViewNavigationTypeOther, and it's an internal link
             if ([[self class] shouldOpenURLRequest:request navigationType:navigationType]){
+#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 100000
+                // CB-11895; openURL with a single parameter is deprecated in iOS 10
+                // see https://useyourloaf.com/blog/openurl-deprecated-in-ios10
+                if ([[UIApplication sharedApplication] respondsToSelector:@selector(openURL:options:completionHandler:)])
{
+                    [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];
+                } else {
+                    [[UIApplication sharedApplication] openURL:url];
+                }
+#else
+                // fall back if on older SDK
                 [[UIApplication sharedApplication] openURL:url];
+#endif
             }
             
             // consume the request (i.e. no error) if it wasn't handled above


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


Mime
View raw message