美文网首页
oc- ios程序内实现打电话

oc- ios程序内实现打电话

作者: 茶饭不思 | 来源:发表于2016-08-10 18:11 被阅读0次

//1、系统的打电话代码,不返回当前程序:

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel://1008611"]];

//2、用UIWebView来实现,打电话结束后会返回当前应用程序:

UIWebView *callPhoneWebVw = [[UIWebView alloc] init];

NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"tel://1008611"]];

[callPhoneWebVw loadRequest:request];

相关文章

网友评论

      本文标题:oc- ios程序内实现打电话

      本文链接:https://www.haomeiwen.com/subject/wzsjsttx.html