Skip to content

Commit

Permalink
Added tel schema handler.
Browse files Browse the repository at this point in the history
  • Loading branch information
devedbox committed Mar 11, 2017
1 parent 1d2e995 commit e3fb685
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions AXWebViewController/AXWebViewController/AXWebViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -923,7 +923,7 @@ - (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigati
// Resolve URL. Fixs the issue: https://github.com/devedbox/AXWebViewController/issues/7
NSURLComponents *components = [[NSURLComponents alloc] initWithString:webView.URL.absoluteString];
// For appstore.
if ([[NSPredicate predicateWithFormat:@"SELF BEGINSWITH[cd] 'https://itunes.apple.com/cn/app/' OR SELF BEGINSWITH[cd] 'mailto:'"] evaluateWithObject:webView.URL.absoluteString]) {
if ([[NSPredicate predicateWithFormat:@"SELF BEGINSWITH[cd] 'https://itunes.apple.com/cn/app/' OR SELF BEGINSWITH[cd] 'mailto:' OR SELF BEGINSWITH[cd] 'tel:'"] evaluateWithObject:webView.URL.absoluteString]) {
if ([[UIApplication sharedApplication] canOpenURL:webView.URL]) {
if (UIDevice.currentDevice.systemVersion.floatValue >= 10.0) {
[UIApplication.sharedApplication openURL:webView.URL options:@{} completionHandler:NULL];
Expand Down Expand Up @@ -1007,7 +1007,7 @@ - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)
// Resolve URL. Fixs the issue: https://github.com/devedbox/AXWebViewController/issues/7
NSURLComponents *components = [[NSURLComponents alloc] initWithString:request.URL.absoluteString];
// For appstore.
if ([[NSPredicate predicateWithFormat:@"SELF BEGINSWITH[cd] 'https://itunes.apple.com/cn/app/' OR SELF BEGINSWITH[cd] 'mailto:'"] evaluateWithObject:request.URL.absoluteString]) {
if ([[NSPredicate predicateWithFormat:@"SELF BEGINSWITH[cd] 'https://itunes.apple.com/cn/app/' OR SELF BEGINSWITH[cd] 'mailto:' OR SELF BEGINSWITH[cd] 'tel:'"] evaluateWithObject:request.URL.absoluteString]) {
if ([[UIApplication sharedApplication] canOpenURL:request.URL]) {
if (UIDevice.currentDevice.systemVersion.floatValue >= 10.0) {
[UIApplication.sharedApplication openURL:request.URL options:@{} completionHandler:NULL];
Expand Down

0 comments on commit e3fb685

Please sign in to comment.