Skip to content

Commit

Permalink
fix(ios): make system open tel, sms, mailto and geo links (apache#881)
Browse files Browse the repository at this point in the history
  • Loading branch information
syrine kriaa committed Jan 28, 2022
1 parent e20c12b commit 69543ea
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ios/CDVWKInAppBrowser.m
Original file line number Diff line number Diff line change
Expand Up @@ -540,8 +540,9 @@ - (void)webView:(WKWebView *)theWebView decidePolicyForNavigationAction:(WKNavig
[self.commandDelegate sendPluginResult:pluginResult callbackId:self.callbackId];
}

//if is an app store link, let the system handle it, otherwise it fails to load it
if ([[ url scheme] isEqualToString:@"itms-appss"] || [[ url scheme] isEqualToString:@"itms-apps"]) {
//if is an app store, tel, sms, mailto or geo link, let the system handle it, otherwise it fails to load it
NSArray * allowedSchemes = @[@"itms-appss", @"itms-apps", @"tel", @"sms", @"mailto", @"geo"];
if ([allowedSchemes containsObject:[url scheme]]) {
[theWebView stopLoading];
[self openInSystem:url];
shouldStart = NO;
Expand Down

0 comments on commit 69543ea

Please sign in to comment.