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
Thank You!
Thanks buddy it was really helpful
So so… thank you so much :D
can we use this method for simulator…?
It won’t work – simulator lacks SIM card
its awesome can we are doing receiving the call in our app
thanks really helpfull demo sir Autoredial code on selected number for user enter number ..on time & second duration…