Apple Multiple Push Notifications Not Displaying in Tray Notification

Basically, I want to make several push notifications in one application visible in the notification tray in iOS.

This script works if my data is turned on when a push notification is triggered through APNS, but only the last one is received if I am offline and come back after a while. This functionality is confirmed by the APNS documentation.

However, this is what worked on WhatsApp:

  • Disabled data connection OFF
  • Sent some messages on WhatsApp
  • Data Connection Enabled
  • Detect multiple push notifications received in Apple notification tray

How does this script work? Can I use APNS for this? If so, how?

See this sample image of several push notifications on WeChat.

+5
ios push-notification apple-push-notifications apns-php
Feb 13 '15 at 2:54
source share
3 answers

As you wrote in your question, this is mentioned in Apple Docs:

If you send multiple notifications to the same device or computer within a short period of time, the push service will only send the last one.

Link

The scenario is only that what you are describing will work if your whatsApp was open in the background when receiving these push notifications . That way, WhatsApp will treat them as local notifications and present them all in the notification center. If whatsApp was closed, you will receive only the last notification, like any other application.

You can easily check this:

  • Finish whatsApp and enable Airplane mode .
  • Send 5 messages from 1 to 5 to the device.
  • Turn off Airplane mode and lock your device.
  • You will see only one msg (the last one you sent aka "5") in the notifications center .

Here's how whatsApp works:

While whatsApp is in the background, one push notification is received (the last user sent is “5” in our example). This msg will not be shown to the user.

whatsApp receives it in the application:didReceiveRemoteNotification:fetchCompletionHandler: and checks their servers if there are any notifications up to "5" that the user has not received. In this case, they will retrieve this data from their servers and present it to the user using local notifications , which is basically a way of presenting data and is generally not associated with APNS.

+5
Feb 16 '15 at 9:15
source share

This is explained in Troubleshooting Push Notifications . Check out the "Some but Not All" section.

-one
Feb 16 '15 at 6:35
source share

As described, you cannot control these push notifications.

However, you may know that from iOS7 a new background execution mode (remote notification) allows the program to wake up the system when it receives a push, allowing you to process some data and then go back to sleep ...

This is probably a trick: using this method to receive push notifications (quietly), and then run your own local notification, instead of @Segev. See here UIBackgroundModes .

-one
Feb 22 '15 at 15:06
source share



All Articles