interface IRCIMIWListener {
    onMessageReceived?: (
        message: RCIMIWMessage,
        left: number,
        offline: boolean,
        hasPackage: boolean,
    ) => void;
    onConnectionStatusChanged?: (status: RCIMIWConnectionStatus) => void;
    onConversationTopStatusSynced?: (
        type: RCIMIWConversationType,
        targetId: string,
        channelId: string,
        top: boolean,
    ) => void;
    onConversationNotificationLevelSynced?: (
        type: RCIMIWConversationType,
        targetId: string,
        channelId: string,
        level: RCIMIWPushNotificationLevel,
    ) => void;
    onRemoteMessageRecalled?: (message: RCIMIWMessage) => void;
    onPrivateReadReceiptReceived?: (
        targetId: string,
        channelId: string,
        timestamp: number,
    ) => void;
    onRemoteMessageExpansionUpdated?: (
        expansion: Map<string, string>,
        message: RCIMIWMessage,
    ) => void;
    onRemoteMessageExpansionForKeyRemoved?: (
        message: RCIMIWMessage,
        keys: string[],
    ) => void;
    onChatRoomMemberChanged?: (
        targetId: string,
        actions: RCIMIWChatRoomMemberAction[],
    ) => void;
    onTypingStatusChanged?: (
        type: RCIMIWConversationType,
        targetId: string,
        channelId: string,
        userTypingStatus: RCIMIWTypingStatus[],
    ) => void;
    onConversationReadStatusSyncMessageReceived?: (
        type: RCIMIWConversationType,
        targetId: string,
        timestamp: number,
    ) => void;
    onChatRoomEntriesSynced?: (roomId: string) => void;
    onChatRoomEntriesChanged?: (
        operationType: RCIMIWChatRoomEntriesOperationType,
        roomId: string,
        entries: Map<string, string>,
    ) => void;
    onRemoteUltraGroupMessageExpansionUpdated?: (
        messages: RCIMIWMessage[],
    ) => void;
    onRemoteUltraGroupMessageModified?: (messages: RCIMIWMessage[]) => void;
    onRemoteUltraGroupMessageRecalled?: (messages: RCIMIWMessage[]) => void;
    onUltraGroupReadTimeReceived?: (
        targetId: string,
        channelId: string,
        timestamp: number,
    ) => void;
    onUltraGroupTypingStatusChanged?: (
        info: RCIMIWUltraGroupTypingStatusInfo[],
    ) => void;
    onMessageBlocked?: (info: RCIMIWBlockedMessageInfo) => void;
    onChatRoomStatusChanged?: (
        targetId: string,
        status: RCIMIWChatRoomStatus,
    ) => void;
    onGroupMessageReadReceiptRequestReceived?: (
        targetId: string,
        messageUId: string,
    ) => void;
    onGroupMessageReadReceiptResponseReceived?: (
        targetId: string,
        messageUId: string,
        respondUserIds: Map<string, number>,
    ) => void;
    onUltraGroupConversationsSynced?: () => void;
    onChatRoomJoining?: (targetId: string) => void;
}

Properties

onMessageReceived?: (
    message: RCIMIWMessage,
    left: number,
    offline: boolean,
    hasPackage: boolean,
) => void

收到消息的监听

Type declaration

    • (
          message: RCIMIWMessage,
          left: number,
          offline: boolean,
          hasPackage: boolean,
      ): void
    • Parameters

      • message: RCIMIWMessage

        接收到的消息对象

      • left: number

        当客户端连接成功后,服务端会将所有补偿消息以消息包的形式下发给客户端,最多每 200 条消息为一个消息包,即一个 Package, 客户端接受到消息包后,会逐条解析并通知应用。left 为当前消息包(Package)里还剩余的消息条数

      • offline: boolean

        消息是否离线消息

      • hasPackage: boolean

        是否在服务端还存在未下发的消息包

      Returns void

onConnectionStatusChanged?: (status: RCIMIWConnectionStatus) => void

网络状态变化

Type declaration

onConversationTopStatusSynced?: (
    type: RCIMIWConversationType,
    targetId: string,
    channelId: string,
    top: boolean,
) => void

会话状态置顶多端同步监听

Type declaration

    • (
          type: RCIMIWConversationType,
          targetId: string,
          channelId: string,
          top: boolean,
      ): void
    • Parameters

      • type: RCIMIWConversationType

        会话类型

      • targetId: string

        会话 ID

      • channelId: string

        频道 ID,仅支持超级群使用,其他会话类型传 null 即可。 频道 ID,仅支持超级群使用,其他会话类型传 null 即可。

      • top: boolean

        是否置顶

      Returns void

onConversationNotificationLevelSynced?: (
    type: RCIMIWConversationType,
    targetId: string,
    channelId: string,
    level: RCIMIWPushNotificationLevel,
) => void

会话状态免打扰多端同步监听

Type declaration

onRemoteMessageRecalled?: (message: RCIMIWMessage) => void

撤回消息监听器

Type declaration

onPrivateReadReceiptReceived?: (
    targetId: string,
    channelId: string,
    timestamp: number,
) => void

单聊中收到消息回执的回调。

Type declaration

    • (targetId: string, channelId: string, timestamp: number): void
    • Parameters

      • targetId: string

        会话 ID

      • channelId: string

        频道 ID,仅支持超级群使用,其他会话类型传 null 即可。

      • timestamp: number

        已阅读的最后一条消息的 sendTime

      Returns void

onRemoteMessageExpansionUpdated?: (
    expansion: Map<string, string>,
    message: RCIMIWMessage,
) => void

消息扩展信息更改的回调

Type declaration

    • (expansion: Map<string, string>, message: RCIMIWMessage): void
    • Parameters

      • expansion: Map<string, string>

        消息扩展信息中更新的键值对,只包含更新的键值对,不是全部的数据。如果想获取全部的键值对,请使用 message 的 expansion 属性。

      • message: RCIMIWMessage

        发生变化的消息

      Returns void

onRemoteMessageExpansionForKeyRemoved?: (
    message: RCIMIWMessage,
    keys: string[],
) => void

消息扩展信息删除的回调

Type declaration

    • (message: RCIMIWMessage, keys: string[]): void
    • Parameters

      • message: RCIMIWMessage

        发生变化的消息

      • keys: string[]

        消息扩展信息中删除的键值对 key 列表

      Returns void

onChatRoomMemberChanged?: (
    targetId: string,
    actions: RCIMIWChatRoomMemberAction[],
) => void

聊天室用户进入、退出聊天室监听

Type declaration

onTypingStatusChanged?: (
    type: RCIMIWConversationType,
    targetId: string,
    channelId: string,
    userTypingStatus: RCIMIWTypingStatus[],
) => void

会话输入状态发生变化。对于单聊而言,当对方正在输入时,监听会触发一次;当对方不处于输入状态时,该监听还会触发一次,但回调里输入用户列表为空。

Type declaration

onConversationReadStatusSyncMessageReceived?: (
    type: RCIMIWConversationType,
    targetId: string,
    timestamp: number,
) => void

同步消息未读状态监听接口。多端登录,收到其它端清除某一会话未读数通知的时候

Type declaration

onChatRoomEntriesSynced?: (roomId: string) => void

聊天室 KV 同步完成的回调

Type declaration

    • (roomId: string): void
    • Parameters

      • roomId: string

        聊天室 ID

      Returns void

onChatRoomEntriesChanged?: (
    operationType: RCIMIWChatRoomEntriesOperationType,
    roomId: string,
    entries: Map<string, string>,
) => void

聊天室 KV 发生变化的回调

Type declaration

onRemoteUltraGroupMessageExpansionUpdated?: (messages: RCIMIWMessage[]) => void

超级群消息 kv 被更新

Type declaration

onRemoteUltraGroupMessageModified?: (messages: RCIMIWMessage[]) => void

超级群消息被更改

Type declaration

onRemoteUltraGroupMessageRecalled?: (messages: RCIMIWMessage[]) => void

超级群消息被撤回

Type declaration

onUltraGroupReadTimeReceived?: (
    targetId: string,
    channelId: string,
    timestamp: number,
) => void

超级群已读的监听

Type declaration

    • (targetId: string, channelId: string, timestamp: number): void
    • Parameters

      • targetId: string

        会话 ID

      • channelId: string

        频道 ID,仅支持超级群使用,其他会话类型传 null 即可。

      • timestamp: number

      Returns void

onUltraGroupTypingStatusChanged?: (
    info: RCIMIWUltraGroupTypingStatusInfo[],
) => void

用户输入状态变化的回调 当客户端收到用户输入状态的变化时,会回调此接口,通知发生变化的会话以及当前正在输入的RCUltraGroupTypingStatusInfo列表

Type declaration

onMessageBlocked?: (info: RCIMIWBlockedMessageInfo) => void

发送含有敏感词消息被拦截的回调

Type declaration

onChatRoomStatusChanged?: (
    targetId: string,
    status: RCIMIWChatRoomStatus,
) => void

聊天室状态发生变化的监听

Type declaration

onGroupMessageReadReceiptRequestReceived?: (
    targetId: string,
    messageUId: string,
) => void

收到群聊已读回执请求的监听

Type declaration

    • (targetId: string, messageUId: string): void
    • Parameters

      • targetId: string

        会话 ID

      • messageUId: string

        消息的 messageUid

      Returns void

onGroupMessageReadReceiptResponseReceived?: (
    targetId: string,
    messageUId: string,
    respondUserIds: Map<string, number>,
) => void

收到群聊已读回执响应的监听

Type declaration

    • (
          targetId: string,
          messageUId: string,
          respondUserIds: Map<string, number>,
      ): void
    • Parameters

      • targetId: string

        会话 ID

      • messageUId: string

        收到回执响应的消息的 messageUId

      • respondUserIds: Map<string, number>

        会话中响应了此消息的用户列表。其中 key: 用户 id ; value: 响应时间。

      Returns void

onUltraGroupConversationsSynced?: () => void

超级群列表同步完成的回调

onChatRoomJoining?: (targetId: string) => void

正在加入聊天室的回调

Type declaration

    • (targetId: string): void
    • Parameters

      • targetId: string

        聊天室 ID

      Returns void