当设备离线时,APNS仅存储一个通知时,whatsapp如何接收多个通知? [英] How does whatsapp receive multiple notification when APNS stores only one in case device is offline?

查看:68
本文介绍了当设备离线时,APNS仅存储一个通知时,whatsapp如何接收多个通知?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据Apple的官方文档,如果设备处于脱机状态,则APNS(Apple推送通知服务)仅存储最后的通知.

According to the official Apple documentation, APNS (Apple Push Notification Service) stores only the last notification if the device is offline.

Apple Push Notification Service包括默认的服务质量 (QoS)组件,执行存储转发功能.如果是APN 尝试传递通知,但设备处于脱机状态,QoS 存储通知. 每个通知仅保留一个通知 设备上的应用程序:从 该应用程序的提供商.当离线设备稍后 重新连接后,QoS会将存储的通知转发到设备. QoS会在删除之前的一段时间内保留通知 它.

Apple Push Notification Service includes a default Quality of Service (QoS) component that performs a store-and-forward function. If APNs attempts to deliver a notification but the device is offline, the QoS stores the notification. It retains only one notification per application on a device: the last notification received from a provider for that application. When the offline device later reconnects, the QoS forwards the stored notification to the device. The QoS retains a notification for a limited period before deleting it.

那么,当设备上线时,诸如whatsapp之类的应用程序如何从多个用户发送消息?如果设备在线,这些消息将作为单独的通知接收.

Then how do apps like whatsapp send messages from multiple users when the device comes online? Those messages would have been received as separate notification if device was online.

推荐答案

在iOS 8上似乎对此问题进行了更新,即使您的用户被手动杀死,它也允许您的应用由于推送而在后台唤醒它.检查一下:

It seems like there was an update to this issue on iOS 8 that will allow your app to wake up in the background due to push even if your user manually killed it. Check this out: Wake your app in the background using PushKit in iOS8.

这意味着您可以将通知发送到您的应用程序,并且一旦重新连接,它将被操作系统唤醒,并能够与您的服务器通信.然后,您可以实施逻辑以向其发送设备离线时丢失的所有推送消息.

This means that you can send notifications to your app and once it's re-connected, it will be woken up by the operating system and will be able to communicate with your server. Then, you can implement the logic to send it all of the push messages that were missed while the device was offline.

我必须承认我还没有自己尝试过,但是听起来这可能是您正在描述的问题的解决方案.

I have to admit that I have yet to try it out myself, but it sounds like this might be the solution to the issue you're describing.

这篇关于当设备离线时,APNS仅存储一个通知时,whatsapp如何接收多个通知?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆