Do not disturb overview
Do not disturb (DND) controls whether the user receives push notifications for missed messages on the client device.
- Client is offline: When a channel has new missed messages, the user receives push notifications by default. After DND is configured, the Nexconn server does not trigger push notifications for the affected messages.
- Client is running in the background: When a channel has new messages, the user receives them directly. If you use the Chat SDK, your app must detect whether it is running in the background and implement local notification popups based on your business requirements.
To disable push notifications entirely, set the enablePush parameter to false in the SDK initialization configuration on first install, or disable push for the current device when disconnecting.
DND configuration dimensions
The Chat SDK supports the following DND dimensions for Direct channels, Group channels, and System channels:
- App Key-level DND
- DND by channel type
- DND by channel (target ID)
- Global DND
App key-level DND
Configure a default DND level for all users under an App Key. By default, this is not set, which means all messages trigger notifications. This configuration is not yet available in the Console. Submit a support ticket if needed.
- All messages: Users under this App Key receive push notifications for all messages.
- Not set: Defaults to notifying for all messages.
- @mention only: Only send push notifications for messages that @mention a specific user or @all group members.
- @specific user only: Users only receive push notifications for messages that @mention them specifically. For example, User A only receives a notification for "@User_A Hello".
- @all members only: Users only receive push notifications for messages that @mention all group members.
- None: Users do not receive push notifications for any offline messages.
- Group messages only with @mention: Users receive push notifications for Direct channel messages, @specific user messages, and @all group members messages.
When the Nexconn server determines whether to send a push notification, App Key-level DND has the lowest priority. Any of the following user-level DND configurations takes precedence:
- DND by channel type
- DND by channel (target ID)
- Global DND
DND by channel type
This is a user-level setting.
The SDK provides ChannelNoDisturbLevel, allowing users to configure which message categories trigger push notifications for a channel type (Direct, Group, Community, or System), or disable notifications entirely. Six levels are available:
| Enum value | Value | Description |
|---|---|---|
ChannelNoDisturbLevel.ALL | -1 | Receive notifications for all messages in channels of the specified type. |
ChannelNoDisturbLevel.DEFAULT | 0 | Not set. This is the initial default state. |
ChannelNoDisturbLevel.MENTION | 1 | Only receive notifications for messages that @mention the current user or @all group members. |
ChannelNoDisturbLevel.MENTION_USERS | 2 | Only receive notifications for messages that @mention the current user specifically. For example, User A only receives a notification for "@User_A Hello". |
ChannelNoDisturbLevel.MENTION_ALL | 4 | Only receive notifications for messages that @mention all group members. |
ChannelNoDisturbLevel.MUTED | 5 | Do not receive any push notifications for channels of the specified type. |
For implementation details, see DND by channel type.
When the Nexconn server determines whether to send a push notification and both of the following user-level configurations exist, those configurations take precedence:
- DND by channel (target ID)
- Global DND
DND by channel (target ID)
This is a user-level setting supported by the SDK.
The SDK provides ChannelNoDisturbLevel, allowing users to configure which message categories trigger push notifications for a specific channel, or disable notifications entirely. Six levels are available:
| Enum value | Value | Description |
|---|---|---|
ChannelNoDisturbLevel.ALL | -1 | Receive notifications for all messages in the specified channel. |
ChannelNoDisturbLevel.DEFAULT | 0 | Not set. This is the initial default state. |
ChannelNoDisturbLevel.MENTION | 1 | Only receive notifications for messages that @mention the current user or @all group members. |
ChannelNoDisturbLevel.MENTION_USERS | 2 | Only receive notifications for messages that @mention the current user specifically. For example, User A only receives a notification for "@User_A Hello". |
ChannelNoDisturbLevel.MENTION_ALL | 4 | Only receive notifications for messages that @mention all group members. |
ChannelNoDisturbLevel.MUTED | 5 | Do not receive any push notifications for the specified channel. |
For implementation details, see DND by target ID.
When the Nexconn server determines whether to send a push notification and the user has a Global DND configuration, the Global DND setting takes precedence.
Global DND
The SDK provides NoDisturbTimeLevel, allowing users to configure when to receive notifications and which message categories trigger notifications. Three levels are available:
| Enum value | Value | Description |
|---|---|---|
NoDisturbTimeLevel.DEFAULT | 0 | Not set. The SDK falls back to checking the channel's user-level DND setting and other non-user-level settings to determine whether to send push notifications. |
NoDisturbTimeLevel.MENTION | 1 | During the specified quiet hours, only receive notifications for messages that @mention the current user or @all group members. |
NoDisturbTimeLevel.MUTED | 5 | During the specified quiet hours, do not receive any push notifications. |
For implementation details, see Global DND.
DND priority
For Direct channels, Group channels, and System channels, the Nexconn server searches DND configurations in the following order. Priority decreases from left to right, and the highest-priority configuration determines whether to trigger a push notification:
Global DND (user-level) > DND by channel type (user-level) > DND by channel / target ID (user-level) > App Key-level DND
API reference
The following table lists DND APIs for Direct channels, Group channels, and System channels.
| DND dimension | Client API | Server API |
|---|---|---|
| Set a global DND level for a specified time period | See Global DND | See DND overview |
| Set DND level by channel type | See DND by channel type | See Set DND by channel type |
| Set DND level by channel (target ID) | See DND by target ID | See Set DND by channel |
| Set App Key-level DND | Not available in the SDK. | Not available via Server API. |