按会话设置免打扰
设置会话的消息免打扰状态
方法
即时通讯业务用户为指定会话或超级群设置免打扰级别,支持单聊、群聊、超级群会话。
C #
int changeConversationNotificationLevel(
RCIMConversationType type,
string targetId,
string channelId,
RCIMPushNotificationLevel level
)
参数说明
| 参数 | 类型 | 说明 |
|---|---|---|
| type | RCIMConversationType | 会话类型。请注意以下限制:
|
| targetId | string | 会话 ID/超级群ID |
| channelId | string | 超级群的会话频道 ID。
|
| level | RCIMPushNotificationLevel | 免打扰级别,参考免打扰概述 |
返回值
| 返回值 | 描述 |
|---|---|
| int | 当次接口操作状态码,并不代表最终操作结果,状态码详细信息 |
代码示例
C #
int code = engine.changeConversationNotificationLevel(
type,
targetId,
channelId,
level
);
回调方法
- onConversationNotificationLevelChanged
C #
delegate void OnConversationNotificationLevelChangedDelegate(
int code, RCIMConversationType type,
string targetId, string channelId,
RCIMPushNotificationLevel level);
OnConversationNotificationLevelChangedDelegate onConversationNotificationLevelChanged;
参数说明
| 参数 | 类型 | 说明 |
|---|---|---|
| code | int | 接口回调的状态码,0 代表成功,非 0 代表出现异常 |
| type | RCIMConversationType | 调用接口时传入的会话类型 |
| targetId | string | 调用接口时传入的会话ID |
| channelId | string | 调用接口时传入的频道 ID |
| level | RCIMPushNotificationLevel | 调用接口时传入的免打扰级别,参考免打扰概述 |
代码示例
C #
engine.onConversationNotificationLevelChanged = delegate(
int code,
RCIMConversationType type,
string targetId,
string channelId,
RCIMPushNotificationLevel level
)
{
}