0

I have changed tel property to do some string manipulation instead of calling that number.

its working in simulator but when i do it device, its still trying to call.

i have tried with webview, textview, button still same problem :(

Any idea?


Let me rephrase

By default, when clicked on any link with tel:xxxx iPhone calls number xxxx But i don't want calling, instead i want to grab xxxx and append that value to my String. How to do that.

Thanks

- (void)viewDidLoad {
    [super viewDidLoad];
    self.htmlString = [self createHTML];

    [webView setBackgroundColor:[UIColor clearColor]];
    [webView setOpaque:NO];
    [webView loadHTMLString:self.htmlString baseURL:nil];
}
- (NSMutableString *) createHTML {
    NSMutableString *tempString =[NSMutableString stringWithFormat:@"<div>"];
    [tempString appendString:@"John Smith"];
    [tempString appendFormat:@"<br> <a href='tel:201207415'>201207415</a>"];
    [tempString appendString:@"</div>"];
    return tempString;
}
- (BOOL)webView:(UIWebView*)webView shouldStartLoadWithRequest:(NSURLRequest*)request     navigationType:(UIWebViewNavigationType)navigationType {
    //CAPTURE USER LINK-CLICK.
    NSURL *url = [request URL];
    NSString *mytext =   [url absoluteString];
    NSLog(@"%@",mytext);
    myLabel.text = mytext;
    return YES;   
}
cnu
  • 815
  • 10
  • 22

1 Answers1

0

If you do not want to call:

- (BOOL)webView:(UIWebView*)webView shouldStartLoadWithRequest:(NSURLRequest*)request     navigationType:(UIWebViewNavigationType)navigationType
{
    return NO;
}

Simulator cannot call anyway.

sch
  • 27,436
  • 3
  • 68
  • 83
Vignesh
  • 10,205
  • 2
  • 35
  • 73