How To Programmatically Dial Phone Number With And Without User Interaction

I stumbled onto a trick for prompting a user before dialing a phone number. Let’s start with the well published option to dial a call directly (no user interaction):

// This will dial a call without prompting the user
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel:1-800-555-1212"]];

If you need to ask the user for confirmation before making a call, here’s where the trick comes in, in the URL @”tel:x-xxx-xxx-xxx” change the tel prefix to telprompt:

NSString *number = @"telprompt://1-800-555-1212";
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:number]];

You’ll now see an alert that looks as follows:

  1. “telprompt://” is not really necessary, just add “//” after “tel:” for user prompt.

    Direct call: tel:1-800-555-1212
    Prompt call: tel://1-800-555-1212

Comments are closed.