Skip to content

Commit 27b9021

Browse files
authored
fix(ios): Replace deprecated APIs (#539)
1 parent 5dac782 commit 27b9021

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/ios/CDVWKWebViewEngine.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,8 @@ - (void)webView:(WKWebView*)theWebView didFailNavigation:(WKNavigation*)navigati
694694

695695
NSURL* errorUrl = vc.errorURL;
696696
if (errorUrl) {
697-
errorUrl = [NSURL URLWithString:[NSString stringWithFormat:@"?error=%@", [message stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]] relativeToURL:errorUrl];
697+
NSCharacterSet *charSet = [NSCharacterSet URLFragmentAllowedCharacterSet];
698+
errorUrl = [NSURL URLWithString:[NSString stringWithFormat:@"?error=%@", [message stringByAddingPercentEncodingWithAllowedCharacters:charSet]] relativeToURL:errorUrl];
698699
NSLog(@"%@", [errorUrl absoluteString]);
699700
[theWebView loadRequest:[NSURLRequest requestWithURL:errorUrl]];
700701
}
@@ -769,7 +770,7 @@ - (void) webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigat
769770
[scheme isEqualToString:@"facetime"] ||
770771
[scheme isEqualToString:@"sms"] ||
771772
[scheme isEqualToString:@"maps"]) {
772-
[[UIApplication sharedApplication] openURL:url];
773+
[[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];
773774
decisionHandler(WKNavigationActionPolicyCancel);
774775
} else {
775776
decisionHandler(WKNavigationActionPolicyAllow);

0 commit comments

Comments
 (0)