开发者

Calling a phone using UIWebview

开发者 https://www.devze.com 2023-02-08 18:59 出处:网络
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 t

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

精彩评论

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