我想问的是:
- 这些应用是依赖 FCM/GCM(或任何其他类型的)推送通知来同步数据,还是通过服务在后台使用套接字连接?
- 如果他们依赖推送通知,那么为什么他们在接收通知(在后台)方面没有任何损失,而我在繁忙时间错过了 10-15% 的通知。
- 如果他们在后台依赖套接字连接,那么 这不是像恐龙一样吃电池吗?
我发现,如果我强行停止 Messenger 和 Facebook,我仍然会收到消息,但比平时晚一些。 此外,在 Messenger、Facebook、Slack 和 Skype 中有一个“允许后台 Activity ”选项,当我禁用该选项时,我根本无法收到通知。 有趣的是,WhatsApp 在其应用程序信息中没有这种选项,如果我只是强制停止 WhatsApp,它就会停止向我显示消息通知。
最佳答案
Whether these apps are relying on FCM/GCM (or any other type of) push notifications for syncing their data or are they using a socket connection in background through a service?
他们必须依赖 FCM。
If they are relying on push notifications then why they don't have any loss in receiving notifications (in background) while I miss 10-15% of notifications in busy hours.
他们必须使用 FCM high priority在打瞌睡模式下可靠地交付。
And if they are relying on a socket connection in background, then ain't this eat battery like a dinosaur?
他们可能没有运行 CPU 密集型工作。
Whatsapp 等移动应用程序必须请求许可才能免除打瞌睡/省电和应用程序待机模式。可以引用我的回答here了解更多详情。
关于android - Whatsapp、Facebook 和 Skype 消息传递如何在后台运行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50989523/