Skip to main content

DND by channel ID

Set the Do Not Disturb (DND) level for a specific sub-channel within a Community channel.

tip

Within user-level DND settings, the priority order is: 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 channel 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 DND for a community channel sub-channel

Create an NCCommunitySubChannelIdentifier with the Community channel ID and sub-channel ID, then instantiate the channel and set the DND level:

swift
import NexconnChatSDK
CommunitySubChannel *subChannel =
[CommunitySubChannel alloc initWithChannelId:@"communityId"
subChannelId:"subChannelId"]
subChannel setNoDisturbLevel:NCChannelNoDisturbLevelMuted
completion:^(NCError *error) {
if (error == nil) {
// NSLog("Sub-channel DND set.")
} else {
// NSLog("Failed: %", error)
}
}

Remove the DND level

Pass NCChannelNoDisturbLevelDefaultLevel to reset to the default:

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