在通话期间将应用程序置于前台
我想在通话期间将我的应用程序带到前台。我知道我有这个 call.callState==CTCallStateConnected
但我想在呼叫状态被视为活动时运行一些命令。
因此,当检测到电话呼叫(连接状态)时,我希望我的应用程序从后台弹出并出现在前台。我只是不确定如何让应用程序在后台运行时注册 CallConnectedState(并在激活后重新打开?)
谢谢!
I wanted to bring my application to the foreground during a phone call. I know I have thiscall.callState==CTCallStateConnected
but I wanted to run some commands when a call state is considered active.
So when a phone call is detected (connected state), I want my application to popup from the background and appear in the foreground. I’m just not sure how to get the application to register that CallConnectedState
when running in the background (and reopen once that is activated?)
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我对 iOS 5 不是 100% 确定,但在 iOS 4.X 下,您当然不能不能以编程方式强制应用程序从后台返回前台。
苹果的理念是用户始终处于控制之中,无论他/她想要在前台运行的应用程序都将保留在前台。
这是 另一个问题与您大致相同。
I'm not 100% certain about iOS 5, but under iOS 4.X you certainly could not programatically force an app from background back into the foreground.
Apple's philosophy is that the user is in control at all times and whatever app s/he wants to be in the foreground stays in the foreground.
Here's another question that has the roughly the same question as you.
Michael 是正确的,但我只是想补充一点,这在任何 iOS 版本(包括 iOS 5)中都是不可能的。当有电话呼叫时,您根本无法强制您的应用程序进入前台。
可能有某种方法可以用越狱的手机来完成此操作,但我不知道如何做。这超出了这个问题的范围。
Michael is correct, but I just wanted to add that this is not possible in any iOS version, which includes iOS 5. You simply cannot force your app to the foreground when a phone call is active.
There may be some way to accomplish this with a jailbroken phone, but I have no idea how. That is outside the scope of this question.