按会话类型设置免打扰
更新时间:2024-01-16
PDF
设置会话的消息免打扰状态
即时通讯业务用户为指定会话或超级群设置免打扰级别
方法
Future<int> changeConversationTypeNotificationLevel(RCIMIWConversationType type, RCIMIWPushNotificationLevel level, {IRCIMIWChangeConversationTypeNotificationLevelCallback? callback});
已复制
1
参数说明
参数名 | 参数类型 | 描述 |
---|---|---|
type | RCIMIWConversationType | 会话类型 |
level | RCIMIWPushNotificationLevel | 消息通知级别 |
callback | IRCIMIWChangeConversationTypeNotificationLevelCallback | 事件回调。SDK 从 5.3.1 版本开始支持 callback 方式回调。从 5.4.0 版本废弃该接口的其他回调方式。如果传入了 callback 参数,仅触发 callback 回调。 |
返回值
返回值 | 描述 |
---|---|
Future<int> | 当次接口操作的状态码。0 代表调用成功 具体结果需要实现接口回调,非 0 代表当前接口调用操作失败,不会触发接口回调,详细错误参考错误码 |
代码示例
IRCIMIWChangeConversationTypeNotificationLevelCallback? callback = IRCIMIWChangeConversationTypeNotificationLevelCallback(onConversationTypeNotificationLevelChanged: (int? code) {
//...
});
int? ret = await engine?.changeConversationTypeNotificationLevel(type, level, callback:callback);
已复制
1
2
3
4
5
回调方法
- onConversationTypeNotificationLevelChanged
Function(int? code, RCIMIWConversationType? type, RCIMIWPushNotificationLevel? level)? onConversationTypeNotificationLevelChanged;
已复制
1
参数说明
参数名 | 参数类型 | 描述 |
---|---|---|
code | int | 接口回调的状态码,0 代表成功,非 0 代表出现异常 |
type | RCIMIWConversationType | 会话类型 |
level | RCIMIWPushNotificationLevel | 消息通知级别 |
代码示例
engine?.onConversationTypeNotificationLevelChanged = (int? code, RCIMIWConversationType? type, RCIMIWPushNotificationLevel? level) {
//...
};
已复制
1
2
3