iOS Tutorial: make call from app programatically

Making call from iOS requires just two lines of code. These will make call without asking a user, and after the call has ended, the control will not come back to your app (see how to come back to app in further section)

Make a call initiated from app

- (void) dialNumber:(NSString*) number{
	number = [@"tel://" stringByAppendingString:number];
	[[UIApplication sharedApplication] openURL:[NSURL URLWithString:number]];
}

Notice, that the number string should contain digits only.

Come back to your app after call has ended

The prefix:

@"telprompt://"

used instead of prefix:

@"tel://"

in phone number URL will cause two things:

  • user will be prompted if he wants to make a call
  • after the call, the control will come back to your app

Did I help you?
I manage this blog and share my knowledge for free sacrificing my time. If you appreciate it and find this information helpful, please consider making a donation in order to keep this page alive and improve quality

Donate Button with Credit Cards

Thank You!

6 thoughts on “iOS Tutorial: make call from app programatically

  1. thanks really helpfull demo sir Autoredial code on selected number for user enter number ..on time & second duration…

Give Your feedback: