Now there may be a customer service application in this category of things, here we do not want to do that kind of instant online chat function, shorten the project cycle. So we're going to just drop the system phone to do this, but we use the system's api-->[[uiapplication sharedapplication] Openurl:[nsurl urlwithstring:@ "Tel ://phonenum "]; But the problem is that when we finish the call, he jumps back to the phone interface of the system, does not conform to the logic of the general application, we have to do the call after the end of the callback to the original interface in our app. Here are two ways to give it to everyone and show the code as follows:
1. Method One: Use the private API to implement callbacks.
[[UIApplication sharedapplication] openurl:[nsurl urlwithstring:@ "telprompt://10086"];
Here use 10086来 test, harassment phone, hehe.
2. Method Two: Use the Web call, this is legal can be approved by the app.
code example:
//UIWebView *phonecallwebview;
-(void) Dialphonenumber: (NSString *) Aphonenumber
{
Nsurl *phoneurl = [Nsurl urlwithstring:[nsstring stringwithformat:@ "tel:%@", Aphonenumber]];
if (!phonecallwebview) {
Phonecallwebview = [[UIWebView alloc] Initwithframe:cgrectzero];
}
[Phonecallwebview loadrequest:[nsurlrequest Requestwithurl:phoneurl];
}
-(void) Dealloc
{
//Cleanup
[Phonecallwebview release], Phonecallwebview = nil;
[Super Dealloc];
}
Implement call callback app inside