Espina
Espina

Reputation: 83

Is there a way to catch the event of alert when placing a call from UIWebView?

I would like to catch the event of user's selection of either "Cancel" or "Call" of the native alert when user makes call from UIWebView.

Is there anyway to do that?

Upvotes: 1

Views: 774

Answers (2)

Nilesh Kikani
Nilesh Kikani

Reputation: 2618

I think this may help you

@interface UIWebView (JavaScriptAlert) 

- (void)webView:(UIWebView *)sender runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame;

@end

@implementation UIWebView (JavaScriptAlert)

- (void)webView:(UIWebView *)sender runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame {
    UIAlertView* dialogue = [[UIAlertView alloc] initWithTitle:nil message:message delegate:nil cancelButtonTitle:@"Okay" otherButtonTitles:nil];
    [dialogue show];
    [dialogue autorelease];
}

@end

Upvotes: 2

iamsult
iamsult

Reputation: 1579

No u cannot capture the event as it is handle by device itself.

Upvotes: 0

Related Questions