Do Not Disturb Feature Overview
The Do Not Disturb feature controls whether users can receive push notifications for offline messages when their client devices are offline.
- Client offline status: When new offline messages arrive in a conversation, users receive them through the push channel by default with notifications displayed. When Do Not Disturb is enabled, the RC service will not trigger push notifications for related messages.
- Client running in background: When new messages arrive in a conversation, users receive them directly. If using IMLib, you need to determine whether the app is running in the background and implement local notification popups based on business requirements.
Prerequisites
Before using the Do Not Disturb feature, ensure you have integrated APNs push notifications.
Do Not Disturb Configuration Dimensions
The client SDK supports configuring Do Not Disturb for one-to-one chats, group chats, and system conversations across multiple dimensions:
- App-level Do Not Disturb settings
- Do Not Disturb level by conversation type
- Do Not Disturb level by conversation
- Global Do Not Disturb
App-Level Do Not Disturb Settings
Configure the default Do Not Disturb level for all users under an App Key. By default, no settings are configured, which means all messages trigger notifications. This level configuration is not yet available in the Console. Submit a ticket if needed.
- Notify all messages: Users under the current App Key can receive push notifications for any message.
- Not set: Defaults to notifying all messages.
- Only notify @mentions: Users under the current App Key receive push notifications only for messages that mention (@) them or all group members.
- Only notify @mentions of the user: Users under the current App Key receive notifications only for messages that mention (@) them. For example, only "Zhang San" will receive notifications for messages like "@Zhang San Hello."
- Only notify @all mentions: Users under the current App Key receive notifications only for messages that mention (@) all group members.
- Do not notify any messages: Users under the current App Key do not receive push notifications for any messages.
- Do not notify group messages except @mentions: Users under the current App Key receive notifications for one-to-one messages, messages that mention (@) them, and messages that mention (@) all group members.
When determining whether to send push notifications, the RC service gives the lowest priority to App Key-level Do Not Disturb settings. If any of the following user-level Do Not Disturb configurations exist, they take precedence:
- Do Not Disturb level by conversation type
- Do Not Disturb level by conversation
- Global Do Not Disturb
Do Not Disturb Level by Conversation Type
Supported from client SDK version 5.2.2.1. This is a user-level setting.
Parameter Description
The client SDK provides RCPushNotificationLevel, allowing users to configure push notification triggers for conversation types (one-to-one chat, group chat, ultra group, system conversation) or disable notifications entirely. It offers six levels:
| Enum Value | Numeric Value | Description |
|---|---|---|
| RCPushNotificationLevelAllMessage | -1 | When disconnected from the RC service, the user receives notifications for all messages in the specified conversation type. |
| RCPushNotificationLevelDefault | 0 | Not set. This is the default state when no configuration exists. |
| RCPushNotificationLevelMention | 1 | When disconnected from the RC service, the user receives notifications only for messages that mention (@) them or all group members in the specified conversation type. |
| RCPushNotificationLevelMentionUsers | 2 | When disconnected from the RC service, the user receives notifications only for messages that mention (@) them in the specified conversation type. For example, "Zhang San" will only receive notifications for messages like "@Zhang San Hello." |
| RCPushNotificationLevelMentionAll | 4 | When disconnected from the RC service, the user receives notifications only for messages that mention (@) all group members in the specified conversation type. |
| RCPushNotificationLevelBlocked | 5 | The user does not receive push notifications for any messages in the specified conversation type. |
For setup details, see Do Not Disturb by Conversation Type.
When determining whether to send push notifications, the RC service prioritizes the following user-level configurations if they exist:
- Do Not Disturb level by conversation
- Global Do Not Disturb
Do Not Disturb Level by Conversation
Supported from client SDK version 5.2.2. This is a user-level setting.
Parameter Description
The client SDK provides RCPushNotificationLevel, allowing users to configure push notification triggers for specific conversations or disable notifications entirely. It offers six levels:
| Enum Value | Numeric Value | Description |
|---|---|---|
| RCPushNotificationLevelAllMessage | -1 | When disconnected from the RC service, the user receives notifications for all messages in the specified conversation. |
| RCPushNotificationLevelDefault | 0 | Not set. This is the default state when no configuration exists. |
| RCPushNotificationLevelMention | 1 | When disconnected from the RC service, the user receives notifications only for messages that mention (@) them or all group members in the specified conversation. |
| RCPushNotificationLevelMentionUsers | 2 | When disconnected from the RC service, the user receives notifications only for messages that mention (@) them in the specified conversation. For example, "Zhang San" will only receive notifications for messages like "@Zhang San Hello." |
| RCPushNotificationLevelMentionAll | 4 | When disconnected from the RC service, the user receives notifications only for messages that mention (@) all group members in the specified conversation. |
| RCPushNotificationLevelBlocked | 5 | The user does not receive push notifications for any messages in the specified conversation. |
For setup details, see Do Not Disturb by Conversation.
When determining whether to send push notifications, the RC service prioritizes the Global Do Not Disturb configuration if it exists.
Global Do Not Disturb
Parameter Description
Starting from version 5.2.2, the client SDK provides RCPushNotificationQuietHoursLevel, allowing users to configure when to receive notifications and which message types trigger them. It offers three levels:
| Enum Value | Numeric Value | Description |
|---|---|---|
| RCPushNotificationQuietHoursLevelDefault | 0 | Not set. If unset, the SDK checks the user-level Do Not Disturb settings for the message's group and other non-user-level settings to determine whether to send notifications. |
| RCPushNotificationQuietHoursLevelMention | 1 | When disconnected from the RC service, the user receives notifications only for messages that mention (@) them or all group members during the specified time window. |
| RCPushNotificationQuietHoursLevelBlocked | 5 | The user does not receive push notifications for any messages during the specified time window. |
For setup details, see Global Do Not Disturb.
SDK versions below 5.2.2 do not support configuring notification triggers by message type and only allow enabling or disabling push notifications.
Do Not Disturb Configuration Priority
For one-to-one chats, group chats, and system conversations, the RC service follows the priority order below to determine whether to trigger push notifications (highest to lowest priority):
Global Do Not Disturb (user-level) > Do Not Disturb by conversation type (user-level) > Do Not Disturb by conversation (user-level) > App-level Do Not Disturb
API Interface List
The table below describes the Do Not Disturb configuration APIs for one-to-one chats, group chats, and system conversations.
| Configuration Dimension | Client API | Server API |
|---|---|---|
| Set the global Do Not Disturb level for the app during specified time windows. | See Global Do Not Disturb. | See Set User Do Not Disturb Period. |
| Set the Do Not Disturb level by conversation type | See Do Not Disturb by Conversation Type. | See Set Do Not Disturb by Conversation Type. |
| Set the Do Not Disturb level by conversation | See Do Not Disturb by Conversation. | See Set Do Not Disturb by Conversation. |
| Set the App-level Do Not Disturb level | Not provided in the client SDK. | Not provided on the server. |