Remove deprecated -[UIApplication openURL] usage.

This commit is contained in:
SBiOSoftWhare
2020-09-01 12:20:44 +02:00
parent 804af49a27
commit 7ccc184e97
4 changed files with 31 additions and 36 deletions

View File

@@ -412,8 +412,15 @@ NSString *const kJavascriptSendResponseToPostMessageAPI = @"riotIOS.sendResponse
if (navigationAction.navigationType == WKNavigationTypeLinkActivated)
{
NSURL *linkURL = navigationAction.request.URL;
// Open links outside the app
[[UIApplication sharedApplication] openURL:navigationAction.request.URL];
[[UIApplication sharedApplication] vc_open:linkURL completionHandler:^(BOOL success) {
if (!success)
{
NSLog(@"[WidgetVC] webView:decidePolicyForNavigationAction:decisionHandler fail to open external link: %@", linkURL);
}
}];
decisionHandler(WKNavigationActionPolicyCancel);
return;
}