多端同步阅读状态
同步消息未读状态
多端登录时,通知其它终端同步某个会话的消息未读状态。
方法
C #
int syncConversationReadStatus(
RCIMConversationType type,
string targetId,
string channelId,
int timestamp
)
参数说明
参数 | 类型 | 说明 |
---|---|---|
type | RCIMConversationType | 会话类型 |
targetId | string | 会话 ID |
channelId | string | 频道 ID,仅支持超级群使用,其他会话类型传 null 即可 |
timestamp | int | 该会话中已读的最后一条消息的发送时间戳 |
代码示例
C #
int code = engine.syncConversationReadStatus(
type,
targetId,
channelId,
timestamp
);
返回值
返回值 | 描述 |
---|---|
int | 当次接口操作状态码,并不代表最终操作结果,状态码详细信息 |
代码示例
C #
int code = engine.syncConversationReadStatus(
type,
targetId,
channelId,
timestamp
);
回调方法
- onConversationReadStatusSynced
C #
delegate void OnConversationReadStatusSyncedDelegate(
int code,
RCIMConversationType type,
string targetId,
string channelId,
long timestamp);
OnConversationReadStatusSyncedDelegate onConversationReadStatusSynced;
参数说明
参数 | 类型 | 说明 |
---|---|---|
code | int | 接口回调的状态码,0 代表成功,非 0 代表出现异常 |
type | RCIMConversationType | 调用接口时传入的会话类型 |
targetId | string | 调用接口时传入的会话ID |
channelId | string | 调用接口时传入的频道 ID |
timestamp | int | 该会话中已读的最后一条消息的发送时间戳 |
代码示例
C #
engine.onConversationReadStatusSynced = delegate(
int code,
RCIMConversationType type,
string targetId,
string channelId,
int timestamp
)
{
}
监听同步消息未读状态
当用户调用syncConversationReadStatus同步消息未读状态时,远端用户会收到该回调