会话未读数
获取所有会话未读数
获取所有会话类型(除聊天室外)的未读数。
方法
C #
int loadTotalUnreadCount(
string channelId
)
参数说明
参数 | 类型 | 说明 |
---|---|---|
channelId | string | 频道 ID,仅支持超级群使用,其他会话类型传 null 即可 |
返回值
返回值 | 描述 |
---|---|
int | 当次接口操作状态码, 并不代表最终操作结果,状态码详细信息 |
代码示例
C #
int code = engine.loadTotalUnreadCount(
channelId
);
回调方法
- onTotalUnreadCountLoaded
C #
delegate void OnTotalUnreadCountLoadedDelegate(
int code,
string channelId,
int count);
OnTotalUnreadCountLoadedDelegate onTotalUnreadCountLoaded;
参数说明
参数 | 类型 | 说明 |
---|---|---|
code | int | 接口回调的状态码,0 代表成功,非 0 代表出现异常 |
channelId | string | 调用接口时传入的频道 ID |
count | int | 未读消息数 |
代码示例
C #
engine.onTotalUnreadCountLoaded = delegate(
int code,
string channelId,
int count
)
{
}
获取 指定会话未读数
获取指定会话(除聊天室外)的所有未读消息个数。
方法
C #
int loadUnreadCount(
RCIMConversationType type,
string targetId,
string channelId
)
参数说明
参数 | 类型 | 说明 |
---|---|---|
type | RCIMConversationType | 会话类型(除聊天室外) |
targetId | string | 会话 Id |
channelId | string | 频道 ID,仅支持超级群使用,其他会话类型传 null 即可 |
返回值
返回值 | 描述 |
---|---|
int | 当次接口操作状态码,并不代表最终操作结果,状态码详细信息 |
代码示例
C #
int code = engine.loadUnreadCount(
type,
targetId,
channelId
);
回调方法
- onUnreadCountLoaded
C #
delegate void OnUnreadCountLoadedDelegate(int code,
RCIMConversationType type,
string targetId,
string channelId,
int count);
OnUnreadCountLoadedDelegate onUnreadCountLoaded;
参数说明
参数 | 类型 | 说明 |
---|---|---|
code | int | 接口回调的状态码,0 代表成功,非 0 代表出现异常 |
type | RCIMConversationType | 调用接口时传入的会话类型 |
targetId | string | 调用接口时传入的会话 Id |
channelId | string | 调用接口时传入的频道 ID |
count | int | 未读消息数 |
代码示例
C #
engine.onUnreadCountLoaded = delegate(
int code,
RCIMConversationType type,
string targetId,
string channelId,
int count
)
{
}
按会话类型获取未读数
获取多个指定会话类型(除聊天室外)的未读数。
方法
C #
int loadUnreadCountByConversationTypes(
List<RCIMConversationType> conversationTypes,
string channelId,
bool contain
)
参数说明
参数 | 类型 | 说明 |
---|---|---|
conversationTypes | List<RCIMConversationType> | RCIMConversationType 会话类型数组。(除聊天室外) |
channelId | string | 频道 ID,仅支持超级群使用,其他会话类型传 null 即可。 |
contain | bool | 是否包含免打扰消息的未读消息数。 |
返回值
返回值 | 描述 |
---|---|
int | 当次接口操作状态码,并不代表最终操作结果,状态码详细信息 |
代码示例
C #
int code = engine.loadUnreadCountByConversationTypes(
conversationTypes,
channelId,
contain)
回调方法
- onUnreadCountByConversationTypesLoaded
C #
delegate void OnUnreadCountByConversationTypesLoadedDelegate(
int code,
List<RCIMConversationType> types,
string channelId,
bool contain,
int count);
OnUnreadCountByConversationTypesLoadedDelegate onUnreadCountByConversationTypesLoaded;
参数说明
参数 | 类型 | 说明 |
---|---|---|
code | int | 接口回调的状态码,0 代表成功,非 0 代表出现异常 |
types | List<RCIMConversationType> | 调用接口时传入的会话类型列表 |
channelId | string | 调用接口时传入的频道 ID |
contain | bool | 是否包含免打扰消息的未读消息数 |
count | int | 未读消息数 |
代码示例
C #
engine.onUnreadCountByConversationTypesLoaded = delegate(code, types, channelId, contain, count){
}
清除指定会话未读数
清除指定会话(除聊天室外)的未读数。
方法
C #
int clearUnreadCount(
RCIMConversationType type,
string targetId,
string channelId,
int timestamp
)
参数说明
参数 | 类型 | 说明 |
---|---|---|
type | RCIMConversationType | 会话类型 (除聊天室外) |
targetId | string | 会话 ID |
channelId | string | 频道 ID,仅支持超级群使用,其他会话类型传 null 即可。 |
timestamp | int | 该会话已阅读的最后一条消息的发送时间戳 |
返回值
返回值 | 描述 |
---|---|
int | 当次接口操作状态码,并不代表最终操作结果,状态码详细信息 |
代码示例
C #
int code = engine.clearUnreadCount(
type,
targetId,
channelId,
timestamp
);
回调方法
- onUnreadCountCleared
C #
delegate void OnUnreadCountClearedDelegate(int code,
RCIMConversationType type,
string targetId,
string channelId,
long timestamp);
OnUnreadCountClearedDelegate onUnreadCountCleared;
参数说明
参数 | 类型 | 说明 |
---|---|---|
code | int | 接口回调的状态码,0 代表成功,非 0 代表出现异常 |
type | RCIMConversationType | 调用接口时传入的会话类型 |
targetId | string | 调用接口时传入的会话 ID |
channelId | string | 调用接口时传入的频道 ID |
timestamp | int | 该会话已阅读的最后一条消息的发送时间戳 |
代码示例
C #
engine.onUnreadCountCleared = delegate(
int code,
RCIMConversationType type,
string targetId,
string channelId,
int timestamp
)
{
}
加载所有@未读数
加载某个会话的所有@未读数
方法
C #
int loadUnreadMentionedCount(
RCIMConversationType type,
string targetId,
string channelId
)
参数说明
参数 | 类型 | 说明 |
---|---|---|
type | RCIMConversationType | 会话类型 |
targetId | string | 会话 ID |
channelId | string | 频道 ID,仅支持超级群使用,其他会话类型传 null 即可。 |