Skip to main content

DND settings by channel type

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

tip

Under user-level DND settings, DND by channel type has the lowest priority. Priorities: Global DND > DND by channel ID > 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 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 type

Create NCChannelTypeNoDisturbLevelParams and call the class method on NCDirectChannel, NCGroupChannel, or the base channel class:

swift
import NexconnChatSDK
let params = NCChannelTypeNoDisturbLevelParams()
params.channelType = .group; // Direct = 1, Group = 3, Community = 10
params.level = NCChannelNoDisturbLevelMuted
GroupChannel setChannelTypeNoDisturbLevelWithParams:params
completion:^(NCError *error) {
if (error == nil) {
// NSLog("DND level set for all group channels.")
} else {
// NSLog("Failed: %", error)
}
}

Remove the DND level for a channel type

Pass NCChannelNoDisturbLevelDefaultLevel to reset:

swift
import NexconnChatSDK
let params = NCChannelTypeNoDisturbLevelParams()
params.channelType = .group
params.level = NCChannelNoDisturbLevelDefaultLevel
GroupChannel setChannelTypeNoDisturbLevelWithParams:params completion:^(NCError *error) {}