O'Reilly logo

Learning Mobile App Development: A Hands-on Guide to Building Apps with iOS and Android by Michael Eierman, Jakob Iversen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Calling a Phone Number

One of the most important hardware features of most mobile devices is the phone. You can also integrate the phone functionality into your app by letting the user call relevant numbers from within the app. Calling a phone number launches the Phone app on the phone, but control is returned to your app when the call is done.

Calling a phone number from within your app is very simple and requires only a single line of code:

[[UIApplication sharedApplication]openURL:                           [NSURL URLWithString:@"telprompt://1234567894"]];

This tells the phone to launch the URL. Any URL starting with telprompt:// will be treated like a phone number. Other URL schemes open other apps. For instance, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required