Skip to content

Commit

Permalink
Added telprompt schema handler.
Browse files Browse the repository at this point in the history
  • Loading branch information
devedbox committed Mar 13, 2017
1 parent 3492e3e commit 82abb2a
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:' OR SELF BEGINSWITH[cd] 'tel:'"] 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:' OR SELF BEGINSWITH[cd] 'telprompt:'"] 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:' OR SELF BEGINSWITH[cd] 'tel:'"] 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:' OR SELF BEGINSWITH[cd] 'telprompt:'"] 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 82abb2a

Please sign in to comment.