开发者

Calling a phone using UIWebview

I am calling a phone using UIWebview which is giving me a alert with "Cancel" and "Call" I want to handle the "Call" and "Cancel" Btns, if i press "Call" i am able to call and if i dismiss the call it is coming back to my application, please he开发者_运维知识库lp me in handling the "Call" and "Cancel" Btns

UIWebview  *webview = [[UIWebView alloc] initWithFrame:[UIScreen Screen].applicationFrame];

[webview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"tel:%@",newNumber]]]];

Thanks a lot!


That is the default behavior of the application.

[[UIApplication sharedApplication]openURL:[NSURL URLWithString:[number stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]];

or

UIWebView *callWebview = [[UIWebView alloc] init];
NSURL *telURL = [NSURL URLWithString:];
[callWebview loadRequest:[NSURLRequest requestWithURL:telURL]]; 

see the difference.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜