菜鸟教程小白 发表于 2022-12-12 15:44:47

android - 移动应用程序实时数据可用性的推送通知系统有多可靠?


                                            <p><p>我正在创建一个社交 android+ios 应用程序,我同时使用苹果推送通知系统和谷歌云消息传递。我在应用程序运行和不运行时都使用推送通知。应用程序运行时我没有使用任何网络套接字,因此通知一直通过 apns 和 gcm 推送。我知道两者都不是 100% 可靠的,这就是我产生困惑的地方。 facebook、instagram、snapchat 和其他应用程序如何确保始终发送通知。他们在应用程序运行时使用 websockets,在应用程序不运行时使用 apns/gcm?如何确保始终通知“好友请求”之类的内容?还是我应该不时访问服务器以保持应用程序更新,以防它错过任何应该推送的信息,如“好友请求”?</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>您可能知道,“真正的”推送通知会传递给适用于 ios 的 APNS 和适用于 android 的 GCM。因此,永远无法保证您的消息的传递。例如,来自 Apple 的文档:</p>

<p> <a href="https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/ApplePushService.html" rel="noreferrer noopener nofollow">https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/ApplePushService.html</a> </p>

<p>tl;dr 是推送通知是“尽力而为”,并且绝不保证。无论如何,除非您想自己构建,否则您将不得不使用诸如 Urban Airship 之类的提供商,但有最好的用例。例如,不要发送给高度分割的受众,而是向他们的 API 发出一个简单的请求,以加快发送时间并希望获得更多保证。 </p></p>
                                   
                                                <p style="font-size: 20px;">关于android - 移动应用程序实时数据可用性的推送通知系统有多可靠?,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/19438491/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/19438491/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: android - 移动应用程序实时数据可用性的推送通知系统有多可靠?