Set Default Do Not Disturb for Groups/Channels
The ultra group feature supports configuring default Do Not Disturb rules for specified groups or group channels. These default rules apply to all group members and are typically set 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.
tipThe user-level settings for IM Do Not Disturb functionality allow controlling Do Not Disturb levels for specific one-to-one chats, group chats, ultra group conversations, and ultra group channels, while also supporting global Do Not Disturb time periods and levels. User-level settings follow this priority order: Global Do Not Disturb > Channel-specific Do Not Disturb > Conversation-specific Do Not Disturb > Conversation-type Do Not Disturb. See Ultra Group Do Not Disturb Overview for details.
-
Default Do Not Disturb rules set for a specific ultra group automatically apply to all its channels. If separate default rules are configured for a channel, those channel-specific settings take 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 Value | Numeric Value | Description |
|---|---|---|
| PUSH_NOTIFICATION_LEVEL_ALL_MESSAGE | -1 | All messages trigger notifications. |
| PUSH_NOTIFICATION_LEVEL_DEFAULT | 0 | Not set. This is the initial state when no level is configured. Note: In this state, if neither the ultra group nor its channels have configurations, the system considers the default level as "notify for all messages". |
| PUSH_NOTIFICATION_LEVEL_MENTION | 1 | Only @mentions trigger notifications, including both @specific users and @all mentions. |
| PUSH_NOTIFICATION_LEVEL_MENTION_USERS | 2 | Only @specific user mentions trigger notifications, and only for the mentioned users. Example: @UserA will notify UserA; @all mentions won't trigger notifications. |
| PUSH_NOTIFICATION_LEVEL_MENTION_ALL | 4 | Only @all mentions trigger notifications (no notifications for @specific user mentions). |
| PUSH_NOTIFICATION_LEVEL_BLOCKED | 5 | No notifications, including @mentions. |
public enum PushNotificationLevel {
NONE(-100),
/** Notify all messages (explicitly disable Do Not Disturb) */
PUSH_NOTIFICATION_LEVEL_ALL_MESSAGE(-1),
/** Not set (fall back to group or app-level settings) // Legacy data uses 0 for unset */
PUSH_NOTIFICATION_LEVEL_DEFAULT(0),
/** For group/ultra group: notify on @all or @mentions including self; for 1:1 chats: no notifications */
PUSH_NOTIFICATION_LEVEL_MENTION(1),
/** For group/ultra group: notify only on @mentions including self (no @all notifications); for 1:1 chats: no notifications */
PUSH_NOTIFICATION_LEVEL_MENTION_USERS(2),
/** For group/ultra group: notify only on @all (no other notifications); for 1:1 chats: no notifications */
PUSH_NOTIFICATION_LEVEL_MENTION_ALL(4),
/** Block all message notifications */
PUSH_NOTIFICATION_LEVEL_BLOCKED(5);
}
Set Default Do Not Disturb Level for an Ultra Group
class OperationCallback {
onSuccess()
onError(ErrorCode code)
}
public void setUltraGroupConversationDefaultNotificationLevel(
final String targetId,
final IRongCoreEnum.PushNotificationLevel level,
final IRongCoreCallback.OperationCallback callback);
Query Default Do Not Disturb Level for an Ultra Group
class ResultCallback {
onSuccess(PushNotificationLevel level)
onError(ErrorCode code)
}
public void getUltraGroupConversationDefaultNotificationLevel(
final String targetId,
final IRongCoreCallback.ResultCallback<IRongCoreEnum.PushNotificationLevel> callback);
Set Default Do Not Disturb Level for a Group Channel
class OperationCallback {
onSuccess()
onError(ErrorCode code)
}
public void setUltraGroupConversationChannelDefaultNotificationLevel(
final String targetId,
final String channelId,
final IRongCoreEnum.PushNotificationLevel level,
final IRongCoreCallback.OperationCallback callback);
Query Default Do Not Disturb Level for a Group Channel
class ResultCallback {
onSuccess(RCPushNotificationLevel level)
onError(ErrorCode code)
}
public void getUltraGroupConversationChannelDefaultNotificationLevel(
final String targetId,
final String channelId,
final IRongCoreCallback.ResultCallback<IRongCoreEnum.PushNotificationLevel> callback);