Little brother looked at a lot of places on the iOS program to make calls, mostly not, today I summed up three ways, each have different, take to share, I hope to give you some help 1, this method, call the phone back to the original application, will stay in the address book, and is directly dialed, not pop-up hints
Nsmutablestring
- Str=[[nsmutablestring alloc] initwithformat:@ "tel:%@", @ "186xxxx6979"];
NSLog (@ "str======%@", str);
[[UIApplication sharedapplication] Openurl:[nsurl Urlwithstring:str]];
2, this method, after the call will return to the original program, will also pop up hints, recommend this
Nsmutablestring str=[[nsmutablestring alloc] initwithformat:@ "tel:%@", @ "186xxxx6979"];
UIWebView Callwebview = [[UIWebView alloc] init];
[Callwebview loadrequest:[nsurlrequest Requestwithurl:[nsurl Urlwithstring:str]];
[Self.view Addsubview:callwebview];
3, this method will also go back to the original program (note here Telprompt), will also pop-up hints
nsmutablestring* str=[[nsmutablestring alloc] initwithformat:@ "telprompt://%@", @ "186xxxx6979"];
NSLog (@ "str======%@", str);
[[UIApplication sharedapplication] Openurl:[nsurl Urlwithstring:str]
Wen/Fu Yu (Jane book author)
Original link: http://www.jianshu.com/p/6809f5bdc9f6
Copyright belongs to the author, please contact the author to obtain authorization, and Mark "book author".
Three ways to make an IOS call