3
votes

I was sending two ios push notifications simultaneously, one silent and one alert.

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

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? If there are ten people chatting with me, I get 10 notifications almost at same time.

Can someone help clear my understanding?

1
Whatsapp and the like use sockets and not push notificatications for chat.Fawad Masud

1 Answers

0
votes

Sending multiple APNS is the same thing as sending single APNS. but let me explain you how to handle multiple APNS.

When your app send multiple APNS at same time the device will show you message like below image.enter image description here

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. 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. you will see the message like above.

Now this is due to APNS handle by OS. but when the app is open then you will receive the APNS in the below method. and from there the TOP apps handle the message. 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.

This is the how I have also manage multiple notification in one of my datting app.

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