ios making call programmatically without quitting app

◇◆丶佛笑我妖孽 提交于 2019-12-08 01:19:18

问题


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.


回答1:


If you're trying to make some kind of dialer - than NO. It's impossible in ios




回答2:


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.




回答3:


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!