菜鸟教程小白 发表于 2022-12-12 21:44:17

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


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

<p>当应用程序处于运行和后台状态时,我通过套接字通知传入调用。</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>使用 VoIP 的应用程序受到苹果的不同对待,并拥有更多特权。过去,这意味着保持与服务器的永久连接,以便在调用发生时得到通知。</p>

<p>这在节能方面不是很有效。</p>

<p>从 iOS8 开始,建议使用 PushKit(推送通知 API)在调用发生时通知您的用户。具有 VoIP 权限的应用将在现场收到通知,无论应用处于何种状态,它都可以唤醒您的应用。</p>

<p>这里是来自苹果的世界:</p>

<blockquote>
<p>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.</p>
</blockquote>

<p> <a href="https://developer.apple.com/library/ios/documentation/Performance/Conceptual/EnergyGuide-iOS/OptimizeVoIP.html" rel="noreferrer noopener nofollow">https://developer.apple.com/library/ios/documentation/Performance/Conceptual/EnergyGuide-iOS/OptimizeVoIP.html</a> </p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - 应用程序终止时通知视频聊天应用程序,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/38941114/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/38941114/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - 应用程序终止时通知视频聊天应用程序