iOS开发打电话的功能

1,这种方法,拨打完电话回不到原来的应用,会停留在通讯录里,而且是直接拨打,不弹出提示

NSMutableString * phoneStr=[[NSMutableString allocinitWithFormat:@"tel:%@",@"188xxxx9851"];

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:phoneStr]];

    

2,这种方法,打完电话后还会回到原来的程序,也会弹出提示,推荐这种

NSMutableString * phoneStr=[[NSMutableString allocinitWithFormat:@"tel:%@",@"188xxxx9851"];

    UIWebView * callWebview = [[UIWebView allocinit];

    [callWebview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:phoneStr]]];

    [self.view addSubview:callWebview];

    

3,这种方法也会回去到原来的程序里(注意这里的telprompt),也会弹出提示

NSMutableString * phoneStr=[[NSMutableString allocinitWithFormat:@"telprompt://%@",@"188xxxx9851"];

   

    [[UIApplication sharedApplicationopenURL:[NSURL URLWithString:phoneStr]]

posted @ 2016-03-01 13:39  sujianbo  阅读(146)  评论(0编辑  收藏  举报