iOS撥打電話

1,這種方法,撥打完電話回不到原來的應用,會停留在通訊錄裏,而且是直接撥打,不彈出提示
 NSMutableString * str=[[NSMutableString allocinitWithFormat:@"tel:%@",@"186xxxx6979"];
    
//            NSLog(@"str======%@",str);
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
    

2,這種方法,打完電話後還會回到原來的程序,也會彈出提示,推薦這種
NSMutableString * str=[[NSMutableString allocinitWithFormat:@"tel:%@",@"186xxxx6979"];
    
UIWebView * callWebview = [[UIWebView allocinit];
    [callWebview 
loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:str]]];
    [
self.view addSubview:callWebview];
    [callWebview 
release];
    [str 
release];




3,這種方法也會回去到原來的程序裏(注意這裏的telprompt),也會彈出提示
 NSMutableString * str=[[NSMutableString allocinitWithFormat:@"telprompt://%@",@"186xxxx6979"];
    
//            NSLog(@"str======%@",str);
    [[UIApplication sharedApplicationopenURL:[NSURL URLWithString:str]]
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章