Skip to main content

DND settings by channel

Set the Do Not Disturb (DND) level for a specific channel. Supported channel types: Direct Channel, Group channel, Community channel.

tip

The Chat SDK supports multi-dimensional, multi-level DND configuration. Under user-level settings, the priority order is: Global DND > DND by channel ID (Community channel sub-channel) > DND by channel > DND by channel type. See DND Overview.

Supported DND levels

Enum valueNumeric valueDescription
NCChannelNoDisturbLevelAllMessage-1Notify for all messages.
NCChannelNoDisturbLevelDefaultLevel0Not set — inherits from channel-type or app-level settings.
NCChannelNoDisturbLevelMention1Notify only for @mention messages (@user and @everyone).
NCChannelNoDisturbLevelMentionUsers2Notify only when the current user is specifically @mentioned.
NCChannelNoDisturbLevelMentionAll4Notify only for @everyone messages.
NCChannelNoDisturbLevelMuted5Suppress all notifications, including mentions.

Set the DND level for a channel

Get the channel instance and call setNoDisturbLevel:completion::

swift
import NexconnChatSDK
// Direct Channel example
let channel = DirectChannel(channelId: "targetUserId")
channel setNoDisturbLevel:NCChannelNoDisturbLevelMuted
completion:^(NCError *error) {
if (error == nil) {
// NSLog("DND level set.")
} else {
// NSLog("Failed: %", error)
}
}
swift
import NexconnChatSDK
// Group channel example
let channel = GroupChannel(channelId: "groupId")
channel setNoDisturbLevel:NCChannelNoDisturbLevelMention
completion:^(NCError *error) {
if (error == nil) {
// NSLog("DND level set.")
}
}

Remove the DND level for a channel

Pass NCChannelNoDisturbLevelDefaultLevel to reset to the default (inherits from channel type or app level):

swift
import NexconnChatSDK
channel setNoDisturbLevel:NCChannelNoDisturbLevelDefaultLevel
completion:^(NCError *error) {}]

Sync DND status across devices

The SDK provides a channel-status synchronization mechanism. Register an NCChannelHandler to receive real-time updates when the DND level is changed on another device. See Sync Channel Status Across Devices.