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

    Interface IRCIMIWListener

    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;
    }
    Index

    Properties

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

    Listen for incoming messages

    Type declaration

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

        • message: RCIMIWMessage

          The received message object

        • left: number

          Number of remaining messages in the current package after client connection

        • offline: boolean

          Indicates if the message is offline

        • hasPackage: boolean

          Checks if there are undelivered message packages on the server

        Returns void

    onConnectionStatusChanged?: (status: RCIMIWConnectionStatus) => void

    Network status change

    Type declaration

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

    Sync session pin status across devices

    Type declaration

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

        • type: RCIMIWConversationType

          Session type

        • targetId: string

          Session ID

        • channelId: string

          Channel ID, only for super groups. Pass null for other session types

        • top: boolean

          Pin status

        Returns void

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

    Multi-device sync for session do-not-disturb status

    Type declaration

    onRemoteMessageRecalled?: (message: RCIMIWMessage) => void

    Message recall listener

    Type declaration

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

    Callback for message receipt in single chat

    Type declaration

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

        • targetId: string

          Conversation ID

        • channelId: string

          Channel ID, only for super groups. Use null for other chat types.

        • timestamp: number

          Send time of the last read message

        Returns void

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

    Callback for message expansion changes

    Type declaration

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

        • expansion: Map<string, string>

          Updated key-value pairs in the message expansion. Only includes the updated pairs, not the full data. Use the message's expansion property to get all key-value pairs.

        • message: RCIMIWMessage

          The message that changed

        Returns void

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

    Callback for deleted message extensions

    Type declaration

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

        • message: RCIMIWMessage

          The message that changed

        • keys: string[]

          List of keys removed from the message extensions

        Returns void

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

    Monitor chat room user join and exit events

    Type declaration

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

    Chat input status changes. For 1:1 chats, the listener triggers once when the other party is typing, and again when they stop. In the latter case, the typing user list in the callback is empty.

    Type declaration

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

    Listen for unread message sync. Triggered when another device clears unread counts for a session

    Type declaration

    onChatRoomEntriesSynced?: (roomId: string) => void

    Callback for chatroom KV sync completion

    Type declaration

      • (roomId: string): void
      • Parameters

        • roomId: string

          Chatroom ID

        Returns void

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

    Callback for chat room KV changes

    Type declaration

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

    Supergroup message KV updated

    Type declaration

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

    Supergroup messages updated

    Type declaration

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

    Supergroup messages recalled

    Type declaration

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

    Listen for supergroup read receipts

    Type declaration

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

        • targetId: string

          Conversation ID

        • channelId: string

          Channel ID, only for supergroups. Set to null for other types.

        • timestamp: number

        Returns void

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

    Callback for user input status changes Triggered when the client detects changes in user input status, notifying the session and current RCUltraGroupTypingStatusInfo list

    Type declaration

    onMessageBlocked?: (info: RCIMIWBlockedMessageInfo) => void

    Callback for intercepted messages containing sensitive words

    Type declaration

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

    Listen for chat room status changes

    Type declaration

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

    Listener for group chat read receipt requests

    Type declaration

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

        • targetId: string

          Conversation ID

        • messageUId: string

          Message UID

        Returns void

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

    Listener for group chat read receipt response

    Type declaration

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

        • targetId: string

          Conversation ID

        • messageUId: string

          messageUId of the message receiving the receipt response

        • respondUserIds: Map<string, number>

          List of users in the conversation who responded to this message. Key: user ID; value: response time.

        Returns void

    onUltraGroupConversationsSynced?: () => void

    Callback when super group list sync completes

    onChatRoomJoining?: (targetId: string) => void

    Callback for joining a chat room

    Type declaration

      • (targetId: string): void
      • Parameters

        • targetId: string

          Chat room ID

        Returns void