Oliver Salzburg
Oliver Salzburg

Reputation: 22099

How can I "collapse" multiple push notifications into one?

On Android, when supplying the same id in two calls to NotificationManager.notify, only one notification will be shown in the notification drawer.

On BlackBerry, when supplying the same tag in two calls to Notification(), only one notification will be shown in the message hub.

What is the equivalent functionality on iOS?

We need to deliver certain push notifications multiple times to make the phone ring and vibrate multiple times, but we only want to have a single message visible on the lock screen.

Upvotes: 3

Views: 1086

Answers (1)

Arru
Arru

Reputation: 163

The method on iOS is very similar in concept to Android and BlackBerry. From Apple's APNs overview:

To allow the coalescing of similar notifications, you can include a collapse identifier with the notification request.

Notifications with the same identifier will be collapsed on the receiving device.

https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/APNSOverview.html#//apple_ref/doc/uid/TP40008194-CH8-SW1

Upvotes: 1

Related Questions