1. In this way, if you can't return to the original application after making a call, it will stay in the address book, and you will dial directly without a prompt pop-up
NSMutableString * str=[[NSMutableString alloc] initWithFormat:@"tel:%@",@"186xxxxxxxx"]; // NSLog(@"str======%@",str); [[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
2. In this way, after making a call, you will return to the original program and a prompt will also pop up. This is usually used.
NSMutableString * str=[[NSMutableString alloc] initWithFormat:@"tel:%@",@"186xxxxxxxx"]; UIWebView * callWebview = [[UIWebView alloc] init]; [callWebview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:str]]]; [ addSubview:callWebview];
3. This way, you will also go back to the original program (note the telprompt here), and a prompt will also pop up.
NSMutableString * str=[[NSMutableString alloc] initWithFormat:@"telprompt://%@",@"186xxxxxxxx"]; // NSLog(@"str======%@",str); [[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]]
The above are the three ways to make iOS phone calls that the editor has introduced to you. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply to you in time. Thank you very much for your support for my website!