如何恢复(或启动)我的电话后,在程序结束的iOS(我的应用程序并*不*发起电话)? [英] How to resume (or launch) my app after a phone call ends in iOS (my app did *not* initiate the phone call)?

查看:162
本文介绍了如何恢复(或启动)我的电话后,在程序结束的iOS(我的应用程序并*不*发起电话)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经看到了几种方法来确保我的应用程序后,再次其中我的应用程序已启动已结束的电话显示不过这不是我想要的 - >我所寻找的是一个办法,说我的应用程序正在运行在后台做网络通信和别人的给我打电话的,我想我的应用程序要么能够检测时,电话已经结束,恢复我的网络通信和/或发射/恢复我的应用程序返回到当电话结束的前景。是否有的方式来完成这样的事情怎么样?

I have seen several ways to "make sure that my app is shown again after a phone call which my app has initiated has ended" however that isn't what I want -> what I am looking for is a way to, say my app is currently running in the background doing network communications and someone calls me, I would like my app to either be able to "detect when the phone call has ended and resume my network communications" and/or "launch/resume my app back into the foreground when the phone call has ended". Is there any way to accomplish something like this and how?

推荐答案

这是不支持iOS的范围内。

This is unsupported within iOS.

从文档:
<一href=\"http://developer.apple.com/iphone/library/documentation/iphone/conceptual/iphoneosprogrammingguide/BackgroundExecution/BackgroundExecution.html\" rel=\"nofollow\">http://developer.apple.com/iphone/library/documentation/iphone/conceptual/iphoneosprogrammingguide/BackgroundExecution/BackgroundExecution.html

<一个href=\"http://developer.apple.com/iphone/library/documentation/NetworkingInternet/Reference/CTCallCenter/Reference/Reference.html#//apple_ref/doc/uid/TP40009604\" rel=\"nofollow\">http://developer.apple.com/iphone/library/documentation/NetworkingInternet/Reference/CTCallCenter/Reference/Reference.html#//apple_ref/doc/uid/TP40009604

如果您的应用程序被激活时调用的事件发生时,系统会立即分派事件的处理程序。然而,呼叫事件也可发生在您的应用程序将被暂停。虽然它被挂起时,你的应用程序不会收到呼叫事件。当应用程序恢复激活状态,它收到的状态发生了改变,无论多少的状态如何改变,而经验丰富的应用程序被暂停通话每次调用单个呼叫事件。发送到您的处理程序,在您的应用程序返回到激活状态的单个呼叫事件,描述了当时通话的状态。

If your application is active when a call event takes place, the system dispatches the event to your handler immediately. However, call events can also take place while your application is suspended. While it is suspended, your application does not receive call events. When your application resumes the active state, it receives a single call event for each call that changed state—no matter how many state changes the call experienced while your application was suspended. The single call event sent to your handler, upon your application returning to the active state, describes the call’s state at that time.

你能做的最好的是检测的电话,而你的应用程序是开放的。

The best you can do is detect phone calls while your app is open.

这篇关于如何恢复(或启动)我的电话后,在程序结束的iOS(我的应用程序并*不*发起电话)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆