How to go to the dialer in iOS

To make a phone call, use [[UIApplication sharedApplication] openURL:@"tel://"]it very simply.

The problem is that I don’t want to dial the number right away, I need it, when the user clicks the “call” button, the application goes to the dialer panel in the phone application and displays a specific phone number, the user can click the “Call” button to make this phone call. Does anyone know how I can achieve this? Appreciate!

+4
source share
1 answer

The iPhone SDK does not allow dialing from an application. But you can do it using UITextField. Set the keyboard type toUIKeyboardTypePhonePad

textfield.keyboardType = UIKeyboardTypePhonePad;

textfield,

textfield.text = numberToDial;

,

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"tel://%@",textfield.text]]];
0

All Articles