Is there any way to make a call programmatically without exiting from current app? I did a research, but all answers are with:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:phoneNumber]];
This is not what I want, I need also to access the voice stream.
If you're trying to make some kind of dialer - than NO. It's impossible in ios
What I understand from your question is to call and after you finish, go back to the app. Is it?
Your scheme need look like this:
NSURL *url= [NSURL URLWithString:[NSString stringWithFormat:@"telprompt://%@", phoneNumber]];
[[UIApplication sharedApplication] openURL:url];
Use telprompt
instead tel
.
What you want can be done using below statement.
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"telprompt://%@", telNumber]]];
What till will do is when you press call button, it will ask you for confirmation to dial or cancel. When you say call, the call goes and once call ends, you will see the app open with last visited page.
Using telprompt
, you get return to app when call ends.
来源:https://stackoverflow.com/questions/22049098/ios-making-call-programmatically-without-quitting-app