简体   繁体   English

顶级应用程序几乎可以同时发送多个ios推送通知?

[英]How the top apps can send multiple ios push notifications almost at same time?

I was sending two ios push notifications simultaneously, one silent and one alert. 我同时发送两个ios推送通知,一个是静音,一个是警报。

Sometimes, one of the push notification is not received on the device. 有时,设备上未收到其中一个推送通知。

When I read about the troubleshooting Push notifications guide - https://developer.apple.com/library/ios/technotes/tn2265/_index.html#//apple_ref/doc/uid/DTS40010376-CH1-TNTAG23 当我阅读有关故障排除推送通知指南时 - https://developer.apple.com/library/ios/technotes/tn2265/_index.html#//apple_ref/doc/uid/DTS40010376-CH1-TNTAG23

It says that - there is a quality of service queue, which holds only one notification per app per device. 它说 - 有一个服务质量队列,每个设备每个应用程序只保留一个通知。 So, can't we send multiple notifications to a device almost at a same time? 那么,我们几乎不能同时向设备发送多个通知吗?

How Whatsapp does it? Whatsapp如何做到这一点? If there are ten people chatting with me, I get 10 notifications almost at same time. 如果有十个人和我聊天,我几乎同时收到10个通知。

Can someone help clear my understanding? 有人可以帮助清除我的理解吗?

Sending multiple APNS is the same thing as sending single APNS. 发送多个APNS与发送单个APNS是一回事。 but let me explain you how to handle multiple APNS. 但是让我解释一下如何处理多个APNS。

When your app send multiple APNS at same time the device will show you message like below image. 当您的应用同时发送多个APNS时,设备会显示如下图像的消息。 在此输入图像描述

But if you look in the notification center. 但是如果你看一下通知中心。 you will see all the message separate. 你会看到所有的信息分开。 Even getting multiple notification in Whatsapp will behave as the above. 即使在Whatsapp中获得多个通知也会如上所述。 If you want to try just turn off you mobile or turn off you internet and send approx 50-60 message to that Whatsapp user. 如果您想尝试关闭您的手机或关闭您的互联网并向该Whatsapp用户发送约50-60消息。 you will see the message like above. 你会看到上面的消息。

Now this is due to APNS handle by OS. 现在这是由于操作系统处理APNS。 but when the app is open then you will receive the APNS in the below method. 但是当应用程序打开时,您将通过以下方法收到APNS。 and from there the TOP apps handle the message. 从那里TOP应用程序处理消息。 Sometimes even thay are also skiping some message due to show some proper message to user. 有时即使是因为向用户显示一些正确的消息,也会滑动一些消息。 like in 0.5 second if you receive 10-15 message then they only show 3-5 message random and set badge count to appropriate chat to indicate user that they have receive message from that user too. 比如在0.5秒内如果你收到10-15条消息,那么它们只会随机显示3-5条消息,并设置徽章计数到适当的聊天,以表明用户他们也收到了来自该用户的消息。

This is the how I have also manage multiple notification in one of my datting app. 这就是我在我的一个数据应用程序中管理多个通知的方式。

func application(application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : AnyObject])

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM