changeConversationNotificationLevel method
Future<int>
changeConversationNotificationLevel(
- RCIMIWConversationType type,
- String targetId,
- String? channelId,
- RCIMIWPushNotificationLevel level, {
- IRCIMIWChangeConversationNotificationLevelCallback? callback,
ZH
设置会话的消息提醒状态 注:超级群调用该接口,channelId 为空时,相当于设置了 channelId 为空的频道的免打扰,不会屏蔽整个超级群会话下所有频道的免打扰
type会话类型。请注意以下限制:超级群会话类型:如在 2022.09.01 之前开通超级群业务,默认不支持为单个超级群会话所有消息设置免打扰级别(“所有消息”指所有频道中的消息和不属于任何频道的消息)。该接口仅设置指定超级群会话(targetId)中不属于任何频道的消息的免打扰状态级别。如需修改请提交工单。聊天室会话类型:不支持,因为聊天室消息默认不支持消息推送提醒。targetId会话 IDchannelId超级群的会话频道 ID。其他类型传 null 即可。如果传入频道 ID,则针对该指定频道设置消息免打扰级别。如果不指定频道 ID,则对所有超级群消息生效。注意:2022.09.01 之前开通超级群业务的客户,如果不指定频道 ID,则默认传 "" 空字符串,即仅针对指定超级群会话(targetId)中不属于任何频道的消息设置免打扰状态级别。如需修改请提交工单。level消息通知级别callback事件回调。SDK 从 5.3.1 版本开始支持 callback 方式回调。从 5.4.0 版本废弃该接口的其他回调方式,预计将在 6.x 版本删除此其他回调方式。如果传入了 callback 参数,仅触发 callback 回调。返回值当次接口操作的状态码。0 代表调用成功 具体结果需要实现接口回调,非 0 代表当前接口调用操作失败,不会触发接口回调,详细错误参考错误码接口回调onConversationNotificationLevelChanged
EN
Set the message notification level for a conversation
Note: When calling this API for an ultra group, if channelId is
empty, it sets the Do Not Disturb level for messages not belonging
to any channel within the specified ultra group conversation. This
does not affect the Do Not Disturb settings for all channels within
the ultra group conversation.
typeThe conversation type. Please note the following restrictions: Ultra group conversation type: For ultra group services activated before 2022.09.01, setting the Do Not Disturb level for all messages in a single ultra group conversation (where "all messages" refers to messages across all channels and messages not belonging to any channel) is not supported by default. This API only sets the Do Not Disturb level for messages not belonging to any channel within the specified ultra group conversation (targetId). To modify this behavior, submit a ticket. Chatroom conversation type: Not supported, as chatroom messages do not support push notifications by default.targetIdThe conversation ID.channelIdThe channel ID for the ultra group conversation. Passnullfor other types. If a channel ID is provided, the Do Not Disturb level is set for the specified channel. If no channel ID is specified, it applies to all messages in the ultra group. Note: For ultra group services activated before 2022.09.01, if no channel ID is specified, pass an empty string"", which sets the Do Not Disturb level only for messages not belonging to any channel within the specified ultra group conversation (targetId). To modify this behavior, submit a ticket.levelThe message notification level.callbackThe event callback. Starting from SDK version 5.3.1, callback is supported. Other callback methods for this API are deprecated as of version 5.4.0 and will be removed in version 6.x. If thecallbackparameter is provided, only the callback will be triggered. successful call, and the specific result needs to be handled in the callback. Non-zero values indicate a failed API call, and no callback will be triggered. Refer to the error codes for detailed error information.
Implementation
Future<int> changeConversationNotificationLevel(
RCIMIWConversationType type,
String targetId,
String? channelId,
RCIMIWPushNotificationLevel level, {
IRCIMIWChangeConversationNotificationLevelCallback? callback,
}) async {
return RCIMWrapperPlatform.instance.changeConversationNotificationLevel(
type,
targetId,
channelId,
level,
callback: callback,
);
}