ios - 应用程序终止时通知视频聊天应用程序

标签 ios sockets

当应用程序处于终止状态时,有什么方法可以通知我的视频聊天应用程序有来电视频通话吗? (就像 Android 后台服务。)

当应用程序处于运行和后台状态时,我通过套接字通知传入调用。

最佳答案

使用 VoIP 的应用程序受到苹果的区别对待,并拥有更多的权限。在过去,这意味着保持与服务器的永久连接,以便在发生调用时收到通知。

这在节能方面并不是很有效。

从 iOS8 开始,建议使用 PushKit(推送通知 API)在调用发生时通知用户。具有 VoIP 权限的应用程序将立即收到通知,并且无论应用程序处于什么状态,都可以唤醒您的应用程序。

这是苹果的世界:

Instead of persistent connections, developers should use the PushKit framework—APIs that allows an app to receive pushes (notifications when data is available) from a remote server. Whenever a push is received, the app is called to action. For example, a VoIP app could display an alert when a call is received, and provide an option to accept or reject the call. It could even begin taking precursory steps to initiate the call, in the event the user decides to accept.

https://developer.apple.com/library/ios/documentation/Performance/Conceptual/EnergyGuide-iOS/OptimizeVoIP.html

关于ios - 应用程序终止时通知视频聊天应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38941114/

相关文章:

c - 连接到环回地址时的管道损坏 (EPIPE)

multithreading - 套接字Winsock异步阻止同时读取写入

c++ - 从网站读取csv文件到c++

ios - 如何通过单击 ios 中的全选按钮来选择 tableview 单元格中的所有复选框按钮

ios - 如何在 swift 注册时根据该 PhoneNumber 检索 uid

ios - 从 Swift 3 中的数组中删除对象

iOS如何有效地将UIView添加到tableview单元格

sockets - socket通信中send()和recv()的行为

Python (UNIX) 套接字——读取所有数据

ios - 我需要从发送者那里获取引用 socket 或其他一些标识符(UITextView)