Skip to main content

Setting Default Do Not Disturb for Groups/Channels

Ultra groups support setting default Do Not Disturb rules for specified ultra groups or group channels. These default rules apply to all group members and are typically configured by ultra group administrators.

If you wish to control the default Do Not Disturb settings for specific ultra groups or channels from your application server, refer to the server API documentation Set Default Do Not Disturb for Ultra Groups/Channels.

Important Notes

  • When RC's server determines whether to push ultra group messages, the default Do Not Disturb configurations for specified ultra groups or channels have lower priority than user-level configurations. If any user-level Do Not Disturb settings exist, they take precedence.

    tip

    The user-level settings for IM service's Do Not Disturb feature allow controlling Do Not Disturb levels for specific one-to-one chats, group chats, ultra group conversations, and ultra group channels, including setting global Do Not Disturb time periods and levels. The priority of user-level settings is as follows: Global Do Not Disturb > Channel-specific Do Not Disturb > Conversation-specific Do Not Disturb > Conversation-type-specific Do Not Disturb. See Ultra Group Do Not Disturb Overview for details.

  • Default Do Not Disturb rules set for an ultra group automatically apply to all its channels. If a channel has its own default Do Not Disturb setting, that channel-specific setting takes precedence.

Supported Do Not Disturb Levels

The default Do Not Disturb level for an ultra group or channel can be set to any of the following:

Enum ValueNumeric ValueDescription
RCPushNotificationLevelAllMessage-1Notify for all messages.
RCPushNotificationLevelDefault0Not set. This is the initial state when no setting is configured.

Note: In this state, if neither the ultra group nor its channels have settings, the default behavior is to notify for all messages.
RCPushNotificationLevelMention1Only notify for @mentions, including @specific users and @all.
RCPushNotificationLevelMentionUsers2Only notify for @specific user mentions, and only notify the mentioned users.

Example: @John will notify John; @all will not trigger notifications.
RCPushNotificationLevelMentionAll4Only notify for @all mentions, meaning only @all messages trigger notifications.
RCPushNotificationLevelBlocked5Block all notifications, including @mentions.
typedef NS_ENUM(NSInteger, RCPushNotificationLevel) {
/*!
Notify for all messages (explicitly disable Do Not Disturb)
*/
RCPushNotificationLevelAllMessage = -1,
/*!
Not set (fall back to group or app-level settings), legacy data uses 0 for unset
*/
RCPushNotificationLevelDefault = 0,
/*!
For group chats/ultra groups: notify when @all or @mentioning self; for one-to-one chats: no notification
*/
RCPushNotificationLevelMention = 1,
/*!
For group chats/ultra groups: notify when @mentioning self (not @all); for one-to-one chats: no notification
*/
RCPushNotificationLevelMentionUsers = 2,
/*!
For group chats/ultra groups: notify only for @all; for one-to-one chats: no notification
*/
RCPushNotificationLevelMentionAll = 4,
/*!
Block all message notifications
*/
RCPushNotificationLevelBlocked = 5,
};

Set Default Do Not Disturb Level for an Ultra Group

Method Signature



- (void)setUltraGroupConversationDefaultNotificationLevel:(NSString *)targetId
level:(RCPushNotificationLevel)level
success:(void (^)(void))successBlock
error:(void (^)(RCErrorCode status))errorBlock;

Parameters

ParameterTypeDescription
targetIdNSStringUltra group conversation targetId.
levelRCPushNotificationLevelDo Not Disturb level.
successBlockBlockSuccess callback.
errorBlockBlockFailure callback. status contains the error code RCErrorCode.

Example Code

[[RCChannelClient sharedChannelManager] setUltraGroupConversationDefaultNotificationLevel:@"targetId"
level:level
success:^{

} error:^(RCErrorCode status) {
}];

Query Default Do Not Disturb Level for an Ultra Group

Method Signature



- (void)getUltraGroupConversationDefaultNotificationLevel:(NSString *)targetId
success:(void (^)(RCPushNotificationLevel level))successBlock
error:(void (^)(RCErrorCode status))errorBlock;

Parameters

ParameterTypeDescription
targetIdNSStringUltra group conversation targetId.
successBlockBlockSuccess callback containing the Do Not Disturb level RCPushNotificationLevel.
errorBlockBlockFailure callback. status contains the error code RCErrorCode.

Example Code

[[RCChannelClient sharedChannelManager] getUltraGroupConversationDefaultNotificationLevel:@"targetId"
success:^(RCPushNotificationLevel level) {

} error:^(RCErrorCode status) {
}];

Set Default Do Not Disturb Level for a Group Channel

Method Signature



- (void)setUltraGroupConversationChannelDefaultNotificationLevel:(NSString *)targetId
channelId:(NSString *)channelId
level:(RCPushNotificationLevel)level
success:(void (^)(void))successBlock
error:(void (^)(RCErrorCode status))errorBlock;

Parameters

ParameterTypeDescription
targetIdNSStringUltra group conversation targetId.
channelIdNSStringUltra group channel channelId.
levelRCPushNotificationLevelDo Not Disturb level.
successBlockBlockSuccess callback.
errorBlockBlockFailure callback. status contains the error code RCErrorCode.

Example Code

[[RCChannelClient sharedChannelManager] setUltraGroupConversationChannelDefaultNotificationLevel:@"targetId"
channelId:@"channelId"
level:level
success:^{

} error:^(RCErrorCode status) {
}];

Query Default Do Not Disturb Level for a Group Channel

Method Signature



- (void)getUltraGroupConversationChannelDefaultNotificationLevel:(NSString *)targetId
channelId:(NSString *)channelId
success:(void (^)(RCPushNotificationLevel level))successBlock
error:(void (^)(RCErrorCode status))errorBlock;

Parameter Description

ParameterTypeDescription
targetIdNSStringTarget ID of the ultra group conversation.
channelIdNSStringChannel ID of the ultra group.
successBlockBlockSuccess callback containing the corresponding Do Not Disturb level RCPushNotificationLevel.
errorBlockBlockFailure callback. status contains the error code RCErrorCode.

Example Code

[[RCChannelClient sharedChannelManager] getUltraGroupConversationChannelDefaultNotificationLevel:@"targetId"
channelId:@"channelId"
success:^(RCPushNotificationLevel level) {

} error:^(RCErrorCode status) {
}];