RongCloud React Native IM Wrapper - v5.34.0
    Preparing search index...

    Interface IRCIMIWListener

    interface IRCIMIWListener {
        onMessageReceived?: (
            message: RCIMIWMessage,
            left: number,
            offline: boolean,
            hasPackage: boolean,
        ) => void;
        onOfflineMessageSyncCompleted?: () => 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;
        onRemoteConversationListSynced?: (code: number) => void;
        onChatRoomJoining?: (targetId: string) => void;
        onChatRoomNotifyMultiLoginSync?: (event: RCIMIWChatRoomSyncEvent) => void;
        onChatRoomNotifyBlock?: (event: RCIMIWChatRoomMemberBlockEvent) => void;
        onChatRoomNotifyBan?: (event: RCIMIWChatRoomMemberBanEvent) => void;
    }
    Index
    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

    onOfflineMessageSyncCompleted?: () => 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

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

    onRemoteConversationListSynced?: (code: number) => void

    远端会话列表同步完成的回调

    Type Declaration

      • (code: number): void
      • Parameters

        • code: number

          接口回调的状态码,0 代表成功,非 0 代表出现异常

        Returns void

    onChatRoomJoining?: (targetId: string) => void

    正在加入聊天室的回调

    Type Declaration

      • (targetId: string): void
      • Parameters

        • targetId: string

          聊天室 ID

        Returns void

    onChatRoomNotifyMultiLoginSync?: (event: RCIMIWChatRoomSyncEvent) => void

    多端登录相关事件通知回调

    Type Declaration

    onChatRoomNotifyBlock?: (event: RCIMIWChatRoomMemberBlockEvent) => void

    封禁用户相关事件通知回调

    Type Declaration

    onChatRoomNotifyBan?: (event: RCIMIWChatRoomMemberBanEvent) => void

    禁言相关事件通知回调

    Type Declaration