当应用程序处于终止状态时,有什么方法可以通知我的视频聊天应用程序有来电视频通话吗? (就像 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.
关于ios - 应用程序终止时通知视频聊天应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38941114/