Skip to content

Commit

Permalink
fix(ios): Replace deprecated APIs (#539)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcesarmobile authored Mar 27, 2020
1 parent 5dac782 commit 27b9021
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ios/CDVWKWebViewEngine.m
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,8 @@ - (void)webView:(WKWebView*)theWebView didFailNavigation:(WKNavigation*)navigati

NSURL* errorUrl = vc.errorURL;
if (errorUrl) {
errorUrl = [NSURL URLWithString:[NSString stringWithFormat:@"?error=%@", [message stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]] relativeToURL:errorUrl];
NSCharacterSet *charSet = [NSCharacterSet URLFragmentAllowedCharacterSet];
errorUrl = [NSURL URLWithString:[NSString stringWithFormat:@"?error=%@", [message stringByAddingPercentEncodingWithAllowedCharacters:charSet]] relativeToURL:errorUrl];
NSLog(@"%@", [errorUrl absoluteString]);
[theWebView loadRequest:[NSURLRequest requestWithURL:errorUrl]];
}
Expand Down Expand Up @@ -769,7 +770,7 @@ - (void) webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigat
[scheme isEqualToString:@"facetime"] ||
[scheme isEqualToString:@"sms"] ||
[scheme isEqualToString:@"maps"]) {
[[UIApplication sharedApplication] openURL:url];
[[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];
decisionHandler(WKNavigationActionPolicyCancel);
} else {
decisionHandler(WKNavigationActionPolicyAllow);
Expand Down

0 comments on commit 27b9021

Please sign in to comment.