diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2017-09-26 01:35:13 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2017-09-26 01:35:13 +0200 |
| commit | 597fa051833ca3df6eb185c0143ff82e02dacba1 (patch) | |
| tree | cb25347477c57f82e955b054b70f4bb5359fb0d2 /StoneIsland/platforms/ios/CordovaLib/Classes/Private | |
| parent | 6a9186aea6b85beef28e3eb765fbf2322a1c7890 (diff) | |
push plugin ugh
Diffstat (limited to 'StoneIsland/platforms/ios/CordovaLib/Classes/Private')
2 files changed, 12 insertions, 1 deletions
diff --git a/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.m b/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.m index bc8f7200..2b13849f 100644 --- a/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.m +++ b/StoneIsland/platforms/ios/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 diff --git a/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewNavigationDelegate.m b/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewNavigationDelegate.m index 6e316595..348c2845 100644 --- a/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewNavigationDelegate.m +++ b/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewNavigationDelegate.m @@ -78,7 +78,7 @@ NSURL* errorUrl = vc.errorURL; if (errorUrl) { - errorUrl = [NSURL URLWithString:[NSString stringWithFormat:@"?error=%@", [message stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]] relativeToURL:errorUrl]; + errorUrl = [NSURL URLWithString:[NSString stringWithFormat:@"?error=%@", [message stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLPathAllowedCharacterSet]] relativeToURL:errorUrl]; NSLog(@"%@", [errorUrl absoluteString]); [theWebView loadRequest:[NSURLRequest requestWithURL:errorUrl]]; } |
