Android notification grouping

更新时间:
复制 MD 格式

Learn how to implement notification grouping across different Android device models.

Introduction

To optimize notification display and improve click-through rates, Mobile Push offers two methods for notification grouping:

Implement notification stacking

Implement notification overriding

Note

Notification stacking places multiple notifications into a single group that can be collapsed or expanded. When expanded, each notification remains independent and clickable.

Notification overriding combines multiple notifications into a single entry. Older notifications in the group are hidden and cannot be clicked. Only the most recent notification is displayed and clickable.

Choose the grouping method that best suits your requirements.

Notification stacking

When sending a notification, set the AndroidNotificationThreadId parameter. Notifications that share the same AndroidNotificationThreadId are stacked into a single group. This method helps users find relevant information and improves click-through rates by reducing clutter in the notification bar.

Important
  1. The AndroidNotificationThreadId parameter is supported in SDK v3.9.2 and later.

  2. If you do not set the AndroidNotificationThreadId parameter, the system displays notifications according to its default rules.

  3. The AndroidNotificationThreadId parameter is effective only for the proprietary channel.

Examples of notification stacking

The following images show a notification group in its collapsed and expanded states.

Single-group example

IOS推送_消息1

Multi-group example

IOS推送_消息2

Implementation

When your server sends a notification, add the AndroidNotificationThreadId parameter. The following table describes this parameter.

Parameter

Type

Optional

Description

AndroidNotificationThreadId

String

Yes

The group ID for notification stacking on the proprietary channel.

Notification overriding

To use notification overriding, set the AndroidNotificationGroup parameter when sending a notification. The system then merges notifications with the same AndroidNotificationGroup value into a single entry. The title of this entry displays the title of the most recent notification, while the content shows a summary message, such as "x unread messages," where x is the number of merged notifications.

Important
  1. The AndroidNotificationGroup parameter is effective for the Huawei channel and Honor channel.

  2. The AndroidNotificationGroup parameter is supported in SDK v3.8.2 and later.

  3. For the proprietary channel, this parameter is only supported in SDK versions 3.8.2 up to, but not including, v3.9.2.

Examples of notification overriding

Single overriding notification

Multiple overriding notifications

If there are multiple overriding notifications from different groups, the system can stack them. The following image shows these stacked notifications in both collapsed and expanded states.

Implementation

When your server sends a notification, add the AndroidNotificationGroup parameter. The following table describes this parameter.

Parameter

Type

Optional

Description

AndroidNotificationGroup

String

Yes

The group ID for notification overriding.