码迷,mamicode.com
首页 > 移动开发 > 详细

iOS 拨打电话三种方式总结

时间:2016-04-23 21:20:40      阅读:190      评论:0      收藏:0      [点我收藏+]

标签:

1,这种方法,拨打完电话回不到原来的应用,会停留在通讯录里,而且是直接拨打,不弹出提示
NSMutableString * str=[[NSMutableString alloc] initWithFormat:@"tel:%@",@"186xxxx6979"];
    //            NSLog(@"str======%@",str);
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
    
2,这种方法,打完电话后还会回到原来的程序,也会弹出提示,推荐这种
NSMutableString * str=[[NSMutableString alloc] initWithFormat:@"tel:%@",@"186xxxx6979"];
    UIWebView * callWebview = [[UIWebView alloc] init];
    [callWebview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:str]]];
    [self.view addSubview:callWebview];
    [callWebview release];
    [str release];

3,这种方法也会回去到原来的程序里(注意这里的telprompt),也会弹出提示
NSMutableString * str=[[NSMutableString alloc] initWithFormat:@"telprompt://%@",@"186xxxx6979"];
    //            NSLog(@"str======%@",str);
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]]
 
 感谢分享
 

iOS 拨打电话三种方式总结

标签:

原文地址:http://www.cnblogs.com/isItOk/p/5425395.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!