ios - 如何在 iOS 中结束电话后恢复(或启动)我的应用程序(我的应用程序没有*未*启动电话)?

标签 ios background launch phone-call resume

我已经看到了几种方法来“确保在我的应用程序启动的电话调用结束后再次显示我的应用程序”但这不是我想要的 -> 我正在寻找的是一种方法,假设我的应用程序当前正在后台运行进行网络通信并且有人给我打电话,我希望我的应用程序能够“检测电话何时结束并恢复我的网络通信”和/或“在电话结束时将我的应用程序启动/恢复到前台”。是否有任何方法来完成这样的事情以及如何完成?

最佳答案

这在 iOS 中不受支持。

来自文档: http://developer.apple.com/iphone/library/documentation/iphone/conceptual/iphoneosprogrammingguide/BackgroundExecution/BackgroundExecution.html

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.

您能做的最好的事情就是在您的应用程序打开时检测电话。

关于ios - 如何在 iOS 中结束电话后恢复(或启动)我的应用程序(我的应用程序没有*未*启动电话)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16492337/

相关文章:

ios - UIPageViewController 点不显示

ios - 重新启动 objective-c 中的对象 - Matchismo 作业 2 - 重新启动游戏

ios - css ipad 2 网站内容在背景上滚动固定

android - 如何从短信内容启动应用程序(链接)

ios - 我可以将 swift 类与 LauchScreen.xib 文件相关联吗

ios - iPad 需要启动图像

iOS:@encode 并直接使用 -> 访问子类的属性

android - 在 Android 视频上绘图并保存

css - 如何将 HTML5 全屏 API 应用于 div 背景图像

html - 在背景大小 :cover 以下显示页脚