Method One: features: Direct dialing, do not eject the hint. And, after the call, stay in the address Book, do not return to the original app.
Call -(void) Callphone: (NSString *) phonenumber { //phonenumber = "18369 ..." Nsmutablestring * str=[[nsmutablestring alloc] initwithformat:@ "tel:%@", PhoneNumber]; [[UIApplication sharedapplication] Openurl:[nsurl urlwithstring:str]; }
Method Two: features: Call before the popup prompt. And will return to the original application after the call is finished.
Call -(void) Callphone: (NSString *) phonenumber { //phonenumber = "18369 ..." Nsmutablestring * str=[[nsmutablestring alloc] initwithformat:@ "tel:%@", PhoneNumber]; UIWebView * Callwebview = [[UIWebView alloc] init]; [Callwebview loadrequest:[nsurlrequest Requestwithurl:[nsurl Urlwithstring:str]]; [Self.view Addsubview:callwebview];
iOS app making phone calls