- 一.點擊即撥打,不會提示用戶是否撥打。相當于點擊了撥打鍵
貌似有的系統調用了這個方法打完電話后,會停留在通話記錄里。
iOS10 親測,打完打完電話會回到原來的程序
NSString *phoneNumber = [NSString stringWithFormat:@"telprompt://%@",@"13377892977"];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:phoneNumber]];
- 二. 利用WebView的方法來打電話
彈出提示,打完回到原程序
NSMutableString * str=[[NSMutableString alloc] initWithFormat:@"tel:%@",@"186xxxx6979"];
UIWebView * callWebview = [[UIWebView alloc] init];
[callWebview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:str]]];
[self.view addSubview:callWebview];
- 三.
[[UIApplication sharedApplication] openURL:]
彈出提示,打完回到原程序
NSMutableString * str=[[NSMutableString alloc] initWithFormat:@"telprompt://%@",@"186xxxx6979"];
// NSLog(@"str======%@",str);
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]]