30、拨打电话方法

1.[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel:186xxxx123"]]; 
测试结果:不弹出提示框,直接跳转到通讯录拨打电话,通话结束返回到app。

2.UIWebView * callWebview = [[UIWebView alloc] init] 
[callWebview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"tel:186xxxx123"]]]; 
[self.view addSubview:callWebview];
 
测试结果:弹出提示框,点击“呼叫”跳转到通讯录拨打电话,通话结束返回到app。

3.[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"telprompt:186xxxx123"]];
测试结果(与2相同):弹出提示框,点击“呼叫”跳转到通讯录拨打电话,通话结束返回到app。

原文地址:https://www.cnblogs.com/qiangzheVSruozhe/p/6826296.html