1.這種方法上真,撥打完*****回不到原來的應(yīng)用肚医,會停留在通訊錄里绢馍,而且是直接撥打,不彈出提示
NSMutableString *str=[[NSMutableString alloc] initWithFormat:@"tel:%@",@"186xxxx6979"];
NSLog(@"str======%@",str);
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
2.這種方法忍宋,打完后還會回到原來的程序痕貌,也會彈出提示,推薦這種
NSMutableString *str2=[[NSMutableString alloc] initWithFormat:@"tel:%@",@"186xxxx6979"];
NSLog(@"%@",str2);
UIWebView * callWebview = [[UIWebView alloc] init];
[callWebview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:str2]]];
[self.view addSubview:callWebview];
3.這種方法也會回去到原來的程序里(注意這里的telprompt)糠排,也會彈出提示
NSMutableString *str3=[[NSMutableString alloc] initWithFormat:@"telprompt://%@",@"186xxxx6979"];
NSLog(@"str======%@",str3);
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:str3]];
注:用第3個的時候要小心舵稠,因為apple的文檔里邊沒出現(xiàn)過telprompt這個。之前是有過被reject的案例入宦。本文轉(zhuǎn)自:http://www.cocoachina.com/bbs/read.php?tid=177141