iOS开发打电话的功能
1,這種方法,撥打完電話回不到原來(lái)的應(yīng)用,會(huì)停留在通訊錄里,而且是直接撥打,不彈出提示
NSMutableString?* phoneStr=[[NSMutableString?alloc]?initWithFormat:@"tel:%@",@"188xxxx9851"];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:phoneStr]];
????
2,這種方法,打完電話后還會(huì)回到原來(lái)的程序,也會(huì)彈出提示,推薦這種
NSMutableString?* phoneStr=[[NSMutableString?alloc]?initWithFormat:@"tel:%@",@"188xxxx9851"];
????UIWebView?* callWebview = [[UIWebView?alloc]?init];
??? [callWebview?loadRequest:[NSURLRequest?requestWithURL:[NSURL?URLWithString:phoneStr]]];
??? [self.view?addSubview:callWebview];
? ??
3,這種方法也會(huì)回去到原來(lái)的程序里(注意這里的telprompt),也會(huì)彈出提示
NSMutableString?* phoneStr=[[NSMutableString?alloc]?initWithFormat:@"telprompt://%@",@"188xxxx9851"];
? ?
? ? [[UIApplication?sharedApplication]?openURL:[NSURL?URLWithString:phoneStr]]
轉(zhuǎn)載于:https://www.cnblogs.com/jianbo-su/p/5230675.html
總結(jié)
以上是生活随笔為你收集整理的iOS开发打电话的功能的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 某中国500强企业BI系统成功应用案例
- 下一篇: 使用正则移除尖括号中的指定子字符串