Reputation: 83
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
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