Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

網頁上有tel: 會無法撥打電話 #20

Closed
tentenlee100 opened this issue Mar 9, 2017 · 4 comments
Closed

網頁上有tel: 會無法撥打電話 #20

tentenlee100 opened this issue Mar 9, 2017 · 4 comments

Comments

@tentenlee100
Copy link
Contributor

tentenlee100 commented Mar 9, 2017

可否在
- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler

- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
加上這段


    if ([navigationAction.request.URL.scheme isEqualToString:@"tel"]) {
        decisionHandler(WKNavigationActionPolicyCancel);
        
        NSString * mutStr = [NSString stringWithFormat:@"telprompt://%@",navigationAction.request.URL.resourceSpecifier];
        if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 10.0) {
            [[UIApplication sharedApplication] openURL:[NSURL URLWithString:mutStr] options:@{} completionHandler:^(BOOL success) {}];
        } else {
            [[UIApplication sharedApplication] openURL:[NSURL URLWithString:mutStr]];
        }
        
        return;
    }

出自於 http://www.jianshu.com/p/e65137ced997

@devedbox
Copy link
Owner

可以,我会在近期更新,或者你可以提一个pr给我!

@devedbox
Copy link
Owner

@tentenlee100 试试这个版本有没有解决问题呢:tag0.4.3

@tentenlee100
Copy link
Contributor Author

要不要把email也放進去? 一些系統的功能

@devedbox
Copy link
Owner

@tentenlee100 下个版本加

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants