NSDictionary *dic = self.names[self.titles[indexPath.section]][indexPath.row];
NSString *phone = dic[@"phoneNumber"];
//1 特点: 直接拨打, 不弹出提示。 并且, 拨打完以后, 留在通讯录中, 不返回到原来的应用。
/*
if (phone != nil) {
NSString *telUrl = [NSString stringWithFormat:@"telprompt:%@",phone];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:telUrl]];
}
*/
//2 特点: 拨打前弹出提示。 并且, 拨打完以后会回到原来的应用。注意: Apple的官方文档中, 没有出现过telprompt, 之前也有人使用这个, 上传审核的时候被拒绝了。
/*
NSMutableString * str=[[NSMutableString alloc] initWithFormat:@"telprompt://%@",phone];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
*/
//3 特点: 拨打前弹出提示。 并且, 拨打完以后会回到原来的应用。
NSString * str=[NSString stringWithFormat:@"tel:%@",phone];
UIWebView * callWebview = [[UIWebView alloc] init];
[callWebview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:str]]];
[self.view addSubview:callWebview];
[callWebview release];
iOS 拨打电话 拨打完以后会回到原来的应用
最新推荐文章于 2018-04-03 17:07:57 发布