清除消息未读状态
超级群业务可在多个客户 端之间同步消息阅读状态。
同步消息已读状态
调用同步已读状态接口会同时清除本地与服务端记录的消息的未读状态,同时服务端会将最新状态同步给同一用户账号的其他客户端。
- 如果指定了频道 ID(channelId),则标记该频道所有消息为全部已读,并同步其他客户端。
 - 如果频道 ID 为空,则标记该超级群会话下所有不属于任何频道的消息为全部已读,并同步其他客户端。
 
提示
超级群暂不支持按时间戳同步已读状态。调用 syncUltraGroupReadStatus 会按指定参数的要求标记全部消息为已读。时间戳参数(timestamp)未使用,可传入任意数字。
方法
C #
int syncUltraGroupReadStatus(
  string targetId,
  string channelId,
  int timestamp
)
参数说明
| 参数 | 类型 | 说明 | 
|---|---|---|
| targetId | string | 超级群ID | 
| channelId | string | 频道ID | 
| timestamp | int | 时间戳 | 
返回值
| 返回值 | 描述 | 
|---|---|
| int | 当次接口操作状态码,并不代表最终操作结果,状态码详细信息 | 
代码示例
C #
int code = engine.syncUltraGroupReadStatus(
  targetId,
  channelId,
  timestamp
);
回调方法
- onUltraGroupReadStatusSynced
 
C #
delegate void OnUltraGroupReadStatusSyncedDelegate(
  int code,
  string targetId,
  string channelId,
  long timestamp);
OnUltraGroupReadStatusSyncedDelegate onUltraGroupReadStatusSynced;
参数说明
| 参数 | 类型 | 说明 | 
|---|---|---|
| code | int | 接口回调的状态码,0 代表成功,非 0 代表出现异常 | 
| targetId | string | 超级群ID | 
| channelId | string | 频道ID | 
| timestamp | int | 时间戳 | 
代码示例
C #
engine.onUltraGroupReadStatusSynced = delegate(
  int code,
  string targetId,
  string channelId,
  int timestamp
)
{
}
监听其他端同步的消息未读状态
当接收到其他端同步的未读状态时,会回调此方法
方法
C #
delegate void OnConversationReadStatusSyncMessageReceivedDelegate(
  RCIMConversationType type,
  string targetId,
  long timestamp);
OnConversationReadStatusSyncMessageReceivedDelegate onConversationReadStatusSyncMessageReceived;
参数说明
| 参数 | 类型 | 说明 | 
|---|---|---|
| type | RCIMConversationType | 会话类型 | 
| targetId | string | 会话 ID | 
代码示例
C #
engine.onConversationReadStatusSyncMessageReceived = delegate(
  RCIMConversationType type,
  string targetId
)
{
}