Package io.rong.imlib

Class ChannelClient

  • All Implemented Interfaces:

    
    public abstract class ChannelClient
    
                        

    获取消息通知免打扰时间。

    Since:

    5.2.2

    • Constructor Detail

      • ChannelClient

        ChannelClient()
    • Method Detail

      • getConversationList

         abstract void getConversationList(IRongCoreCallback.ResultCallback<List<Conversation>> callback, String channelId)

        Retrieves the local conversation list of the current user. The returned list includes the following types of conversations: one-to-one chat, group, discussion group, and system conversation.

        This method reads the conversation list from the local database. The returned conversation list is sorted in chronological order, with pinned conversations appearing first.

        If you need to retrieve other types of conversation lists, use getConversationList.

        This method should be called after the database connection is opened, as indicated by the OnDatabaseOpened callback, IRongCoreCallback.ConnectCallback.

        Parameters:
        callback - The callback for retrieving the conversation list.
        channelId - The business identifier of the conversation to which the message belongs.
        Since:

        5.1.1

      • getConversationList

         abstract void getConversationList(String channelId, IRongCoreCallback.ResultCallback<List<Conversation>> callback, Array<ConversationType> conversationTypes)

        Retrieves the local conversation list of the current user based on the conversation type.

        Parameters:
        channelId - The business identifier of the conversation to which the message belongs.
        callback - The callback for retrieving the conversation list.
        conversationTypes - The types of conversations to retrieve.
        Since:

        5.1.1

      • getTopConversationList

         abstract void getTopConversationList(IRongCoreCallback.ResultCallback<List<Conversation>> callback, String channelId, Array<ConversationType> conversationTypes)

        Retrieves the pinned conversation list based on the conversation type.

        Parameters:
        channelId - Specifies the business identifier of the conversation to which the message belongs.
        Since:

        5.1.1

      • getConversationListByPage

         abstract void getConversationListByPage(IRongCoreCallback.ResultCallback<List<Conversation>> callback, long timeStamp, int count, String channelId, Array<ConversationType> conversationTypes)

        Fetches the conversation list in a paginated manner.

        Parameters:
        callback - Callback for retrieving the conversation list.
        timeStamp - Timestamp in milliseconds.
        count - The number of conversations to retrieve.
        channelId - The business identifier of the conversation to which the message belongs.
        conversationTypes - The types of conversations to retrieve.
        Since:

        5.1.1

      • getConversationListByPage

         abstract void getConversationListByPage(IRongCoreCallback.ResultCallback<List<Conversation>> callback, long timeStamp, int count, String channelId, boolean topPriority, Array<ConversationType> conversationTypes)

        Retrieves the conversation list in a paginated manner.

        Parameters:
        callback - The callback for retrieving the conversation list.
        timeStamp - The timestamp in milliseconds.
        count - The number of conversations to retrieve.
        channelId - The business identifier of the conversation to which the messages belong.
        topPriority - Whether to prioritize displaying pinned messages (sorting method for query results, whether pinned messages take precedence.
        conversationTypes - The types of conversations to retrieve.
        Since:

        5.6.9

      • getBlockedConversationList

         abstract void getBlockedConversationList(IRongCoreCallback.ResultCallback<List<Conversation>> callback, String channelId, Array<ConversationType> conversationTypes)

        Retrieves the list of Do Not Disturb conversations.

        Parameters:
        callback - Callback for retrieving Do Not Disturb conversations.
        channelId - Business identifier of the conversation to which the message belongs.
        conversationTypes - Conversation type, Note: This parameter must be provided and cannot be null.
        Since:

        5.1.1

      • getUnreadConversationList

         abstract void getUnreadConversationList(IRongCoreCallback.ResultCallback<List<Conversation>> callback, Array<ConversationType> conversationTypes)

        Retrieves the list of unread local conversations for the current user based on the conversation type.

        Parameters:
        callback - Callback for retrieving the conversation list.
        conversationTypes - The types of conversations to retrieve.
        Since:

        5.3.2

      • getConversation

         abstract void getConversation(ConversationType conversationType, String targetId, String channelId, IRongCoreCallback.ResultCallback<Conversation> callback)

        Retrieve information for a single conversation.

        Parameters:
        conversationType - Specifies the type of conversation.
        targetId - Indicates the conversation ID.
        channelId - Represents the business identifier of the conversation to which the message belongs.
        callback - Callback for retrieving conversation information.
        Since:

        5.1.1

      • getConversations

         abstract void getConversations(List<ConversationIdentifier> conversationIdentifiers, IRongCoreCallback.ResultCallback<List<Conversation>> callback)

        Method to retrieve the conversation list.

        Functionality: Fetches the corresponding conversation objects based on the provided list of conversation identifiers.

        This method can be implemented to handle conversation retrieval, such as loading conversation data from a database or requesting it from the network.

        Parameters:
        conversationIdentifiers - List of conversation identifiers specifying the conversations to retrieve.
        callback - Callback for the conversation retrieval result, containing the list of conversation objects or error information.
        Since:

        5.8.2

      • updateConversationInfo

         abstract void updateConversationInfo(ConversationType conversationType, String targetId, String channelId, String title, String portrait, IRongCoreCallback.ResultCallback<Boolean> callback)

        Updates conversation information.

        Parameters:
        conversationType - The type of conversation
        targetId - The ID of the conversation
        channelId - The business identifier of the conversation to which the message belongs
        title - The title of the conversation
        portrait - The avatar of the conversation
        callback - The callback
        Since:

        5.1.1

      • removeConversation

         abstract void removeConversation(ConversationType conversationType, String targetId, String channelId, IRongCoreCallback.ResultCallback<Boolean> callback)

        Removes a conversation from the conversation list.

        This method does not delete the messages within the conversation. If new messages are received in this conversation, the conversation will reappear in the conversation list, displaying the most recent history messages.

        Parameters:
        conversationType - The type of conversation .
        targetId - The ID of the conversation.
        channelId - The business identifier of the conversation to which the message belongs.
        callback - The callback indicating whether the conversation was successfully removed, of type Boolean, ResultCallback<Boolean>.
        Since:

        5.1.1

      • removeConversations

         abstract void removeConversations(List<ConversationIdentifier> conversationIdentifiers, IRongCoreCallback.ResultCallback<Boolean> callback)

        Removes a conversation from the conversation list in bulk.

        This method does not delete messages within the conversation. If new messages are received in this conversation, it will reappear in the conversation list with the latest historical messages displayed.

        Supported conversation types: one-to-one chat, group chat, system message.

        Parameters:
        conversationIdentifiers - List of conversation identifiers, with a maximum of 20.
        callback - Callback indicating whether the removal was successful.
        Since:

        5.6.7

      • setConversationToTop

         abstract void setConversationToTop(ConversationType conversationType, String targetId, String channelId, boolean isTop, IRongCoreCallback.ResultCallback<Boolean> callback)

        Sets the pinned status of a conversation.

        If the conversation does not exist, the SDK will automatically create and pin it when this method is called.

        Parameters:
        conversationType - The type of conversation .
        targetId - The ID of the conversation.
        channelId - The business identifier of the conversation to which the message belongs.
        isTop - Whether to pin the conversation.
        callback - Callback indicating whether the pinning operation was successful.
        Since:

        5.6.8

      • setConversationToTop

        @Deprecated() abstract void setConversationToTop(ConversationType conversationType, String targetId, String channelId, boolean isTop, boolean needCreate, IRongCoreCallback.ResultCallback<Boolean> callback)

        Sets the pinned status of a conversation.

        If the conversation does not exist, calling this method will automatically create and pin the conversation.

        Parameters:
        conversationType - The type of conversation .
        targetId - The ID of the conversation.
        channelId - The business identifier of the conversation to which the message belongs.
        isTop - Whether to pin the conversation.
        needCreate - Whether to create the conversation if it does not exist.
        callback - Callback to indicate whether the pinning operation was successful.
        Since:

        5.1.1

      • setConversationToTop

         abstract void setConversationToTop(ConversationType conversationType, String id, String channelId, boolean isTop, boolean needCreate, boolean needUpdateTime, IRongCoreCallback.ResultCallback<Boolean> callback)

        Sets the pinned status of a conversation.

        If the conversation does not exist, calling this method will automatically create and pin the conversation.

        Parameters:
        conversationType - The type of conversation .
        id - The ID of the conversation.
        channelId - The business identifier of the conversation to which the message belongs.
        isTop - Whether to pin the conversation.
        needCreate - Whether to create the conversation if it does not exist.
        needUpdateTime - Whether to update the conversation timestamp.
        callback - Callback indicating whether the pinning operation was successful.
        Since:

        Dedicated Cloud 5.6.2

      • setConversationsToTop

         abstract void setConversationsToTop(List<ConversationIdentifier> conversationIdentifiers, boolean isTop, boolean needCreate, IRongCoreCallback.ResultCallback<Boolean> callback)

        Asynchronously batch sets the top status of conversations

        Parameters:
        conversationIdentifiers - List of conversation identifiers, maximum of 20
        isTop - Whether to pin the conversation
        needCreate - Whether to create a conversation if it does not exist
        callback - Callback result.
        Since:

        5.6.7

      • getTotalUnreadCount

         abstract void getTotalUnreadCount(String channelId, IRongCoreCallback.ResultCallback<Integer> callback)

        Get the total count of unread messages across all conversations.

        Note: Chatroom messages are not included in the count.

        Parameters:
        channelId - The business identifier of the conversation to which the message belongs.
        callback - Callback for the unread message count.
        Since:

        5.1.1

      • getUnreadCount

         abstract void getUnreadCount(ConversationType conversationType, String targetId, String channelId, IRongCoreCallback.ResultCallback<Integer> callback)

        Retrieves the count of unread messages for a specified conversation.

        Note: Chatroom messages are not included in the count.

        Parameters:
        conversationType - The type of conversation .
        targetId - The ID of the conversation.
        channelId - The business identifier of the conversation to which the message belongs.
        callback - Callback for the unread message count.
        Since:

        5.1.1

      • getUnreadCount

         abstract void getUnreadCount(IRongCoreCallback.ResultCallback<Integer> callback, String channelId, Array<ConversationType> conversationTypes)

        Retrieves the total count of unread messages for specified conversation types.

        Note: Chatroom messages are not included in the count.

        Parameters:
        callback - Callback for the unread message count.
        channelId - Business identifier of the conversation to which the messages belong.
        conversationTypes - Conversation types, multiple types can be passed.
        Since:

        5.1.1

      • getUnreadCount

         abstract void getUnreadCount(Array<ConversationType> conversationTypes, String channelId, boolean containBlocked, IRongCoreCallback.ResultCallback<Integer> callback)

        Retrieve the total count of unread messages for specified conversation types.

        Note: Chatroom messages are not included in the count.

        Parameters:
        conversationTypes - Array of conversation types .
        channelId - Business identifier of the conversation to which the messages belong.
        containBlocked - Indicates whether to include unread messages from muted conversations.
        callback - Callback for the unread message count.
        Since:

        5.1.1

      • getMessageCount

         abstract void getMessageCount(ConversationType conversationType, String targetId, String channelId, IRongCoreCallback.ResultCallback<Integer> callback)

        Retrieves the total number of messages in a specified conversation.

        Parameters:
        conversationType - The type of the conversation .
        targetId - The ID of the conversation.
        channelId - The business identifier of the conversation to which the message belongs.
        callback - The callback for the total number of messages.
        Since:

        5.1.1

      • getLatestMessages

         abstract void getLatestMessages(ConversationType conversationType, String targetId, String channelId, int count, IRongCoreCallback.ResultCallback<List<Message>> callback)

        Retrieves the latest messages of a specified conversation.

        Parameters:
        conversationType - The type of the conversation .
        targetId - The ID of the conversation.
        channelId - The business identifier of the conversation to which the message belongs.
        count - The number of messages to retrieve.
        callback - The callback for retrieving the latest messages, sorted in descending order by time.
        Since:

        5.1.1

      • getHistoryMessages

         abstract void getHistoryMessages(ConversationType conversationType, String targetId, String channelId, String objectName, int oldestMessageId, int count, IRongCoreCallback.ResultCallback<List<Message>> callback)

        Retrieves a list of messages in the conversation that meet the specified criteria.

        The returned messages do not include the message corresponding to oldestMessageId. If the number of messages in the conversation is less than the value of the count parameter, all messages in the conversation will be returned.

        For example, if oldestMessageId is 10 and count is 2, the method will return a list of Message objects with messageIds 9 and 8.

        Note: This method does not support fetching historical messages for chatrooms CHATROOM.

        This method only retrieves messages from the local database.

        Note: Starting from version 5.4.4, this method supports the ultra group type. Ultra groups do not receive offline messages. Calling this method for ultra groups may result in message gaps. Use the message gap interface to retrieve ultra group messages.

        Parameters:
        conversationType - The type of conversation .
        targetId - The ID of the conversation.
        channelId - The business identifier of the conversation to which the message belongs.
        objectName - The type identifier of the message.
        oldestMessageId - The ID of the last message.
        count - The number of messages to retrieve.
        callback - The callback for retrieving historical messages, ordered from newest to oldest.
        Since:

        5.1.1

      • getHistoryMessages

         abstract void getHistoryMessages(ConversationType conversationType, String targetId, String channelId, String objectName, int baseMessageId, int count, RongCommonDefine.GetMessageDirection direction, IRongCoreCallback.ResultCallback<List<Message>> callback)

        Retrieves a list of messages in the conversation that meet the specified criteria.

        For example, to retrieve the 10 image messages before the message with messageId 22, the corresponding parameters would be: getHistoryMessages(conversationType, targetId, RC:ImgMsg, 22, 10, true, resultCallback).

        Note: This method does not support fetching historical messages for chatrooms CHATROOM.

        This method only retrieves messages from the local database.

        Note: Starting from version 5.4.4, this method supports the ultra group type. Ultra groups do not receive offline messages, and calling this method for ultra groups may result in missing messages. Please use the missing message interface to retrieve messages for ultra groups.

        Parameters:
        conversationType - The type of conversation .
        targetId - The conversation ID.
        channelId - The business identifier for the conversation to which the message belongs.
        objectName - The message type identifier.
        baseMessageId - The starting message ID.
        count - The number of messages to retrieve.
        direction - The direction of the messages relative to the baseMessageId .
        callback - The callback for retrieving historical messages, ordered from newest to oldest.
        Since:

        5.1.1

      • getHistoryMessages

         abstract void getHistoryMessages(ConversationType conversationType, String targetId, String channelId, List<String> objectNames, long timestamp, int count, RongCommonDefine.GetMessageDirection direction, IRongCoreCallback.ResultCallback<List<Message>> callback)

        Retrieves a list of messages that meet the specified criteria in the conversation.

        For example, to retrieve the 10 image and text messages before the message with messageId 22, the objectNames should be a List of strings like:

        objectNames.add(RC:ImgMsg);
        objectNames.add(RC:TxtMsg);

        The corresponding parameters would be: getHistoryMessages(conversationType, targetId, objectNames, 22, 10, true, resultCallback).

        This method only retrieves messages from the local database.

        Note: Since version 5.4.4, this method supports the ultra group type. Ultra groups do not receive offline messages, and calling this interface for ultra groups may result in message gaps. Please use the gap message interface to retrieve ultra group messages.

        Parameters:
        conversationType - The type of conversation , chatrooms are not supported.
        targetId - The conversation ID.
        channelId - The business identifier of the conversation to which the message belongs.
        objectNames - A List of message type identifiers.
        timestamp - The timestamp of the current message.
        count - The number of messages to retrieve.
        direction - The direction of the messages to retrieve relative to the current message io.rong.imlib.RongCommonDefine.
        callback - The callback for retrieving historical messages, ordered from newest to oldest.
        Since:

        5.1.1

      • getRemoteHistoryMessages

         abstract void getRemoteHistoryMessages(ConversationType conversationType, String targetId, String channelId, long dateTime, int count, IRongCoreCallback.ResultCallback<List<Message>> callback)

        Retrieves historical messages before the specified time from the server. (Not supported for ultra groups)

        Unlike getHistoryMessages, this API pulls messages from the RCserver. After pulling messages from the server, the client performs deduplication and returns the deduplicated data. This is typically used to retrieve historical messages after switching to a new device. When using this API, it is recommended to first retrieve historical messages from the local database using getHistoryMessages. If no historical messages are found in the local database, then use this API to retrieve messages from the server, passing the timestamp of the earliest message in the local database.Note: 1. This feature requires enabling the historical message cloud storage function in the RCdeveloper console. 2. If the messages to be retrieved already exist in the local database, this API will not return any data.

        Parameters:
        conversationType - The type of conversation.
        targetId - The target conversation ID.
        channelId - The business identifier of the conversation to which the message belongs.
        dateTime - The starting point in time from which to retrieve messages.
        count - The number of messages to retrieve, 1 < count <= 20.
        callback - The callback for retrieving historical messages, sorted in chronological order from newest to oldest.
        Since:

        5.1.1

      • getRemoteHistoryMessages

         abstract void getRemoteHistoryMessages(ConversationType conversationType, String targetId, String channelId, RemoteHistoryMsgOption remoteHistoryMsgOption, IRongCoreCallback.ResultCallback<List<Message>> callback)

        Retrieves the remote history messages for a specified conversation. (Not supported for ultra groups)

        This feature requires enabling the Cloud Storage for History Messages in the RongCloud Developer Console.Note: Chatrooms are not supported!

        Parameters:
        conversationType - The type of conversation.
        targetId - The conversation ID.
        channelId - The business identifier of the conversation to which the message belongs.
        remoteHistoryMsgOption - Configurable parameters RemoteHistoryMsgOption
        callback - The callback for retrieving history messages, ordered from newest to oldest.
        Since:

        5.1.1

      • cleanRemoteHistoryMessages

         abstract void cleanRemoteHistoryMessages(ConversationType conversationType, String targetId, String channelId, long recordTime, IRongCoreCallback.OperationCallback callback)

        Clears historical messages stored on the server.

        Clears server-side historical messages before the specified timestamp for a specific conversation based on the conversation type and target conversation ID. After successful clearance, only historical messages after this timestamp can be retrieved from the server.

        Note: The historical message cloud storage feature must be enabled first!

        Parameters:
        conversationType - Specifies the conversation type.
        targetId - Specifies the conversation ID.
        channelId - Specifies the business identifier of the message's conversation.
        recordTime - Specifies the timestamp up to which messages will be cleared.
        callback - Callback for the message clearance operation.
        Since:

        5.1.1

      • cleanHistoryMessages

         abstract void cleanHistoryMessages(ConversationType conversationType, String targetId, String channelId, long recordTime, boolean cleanRemote, IRongCoreCallback.OperationCallback callback)

        Deletes messages before the specified timestamp, with the option to delete server-side messages as well.

        This method can clear historical messages from the server, but the historical message cloud storage feature must be enabled first.

        Clears local database messages (server-side historical messages) before the specified timestamp for a specific conversation based on the conversation type and conversation ID. After successful deletion, only historical messages after this timestamp can be retrieved from the local database (server-side).

        Parameters:
        conversationType - The type of conversation.
        targetId - The ID of the conversation.
        channelId - The business identifier of the conversation to which the message belongs.
        recordTime - The timestamp up to which messages will be cleared.
        cleanRemote - Whether to delete server-side messages.
        callback - The callback for message deletion.
        Since:

        5.1.1

      • getHistoryMessages

         abstract void getHistoryMessages(ConversationType conversationType, String targetId, int oldestMessageId, int count, String channelId, IRongCoreCallback.ResultCallback<List<Message>> callback)

        Retrieves the latest message entities of the specified type from a conversation, starting before a specified message and limited by a specified count.

        Note: This method does not support chatrooms!

        This method only retrieves messages from the local database.

        Note: Since version 5.4.4, this method supports ultra group types. Ultra groups do not receive offline messages, and calling this method for an ultra group may result in message gaps. Use the message gap interface to retrieve messages for ultra groups.

        Parameters:
        conversationType - The type of conversation.
        targetId - The ID of the conversation.
        oldestMessageId - The ID of the last message.
        count - The number of messages to retrieve.
        channelId - The business identifier of the conversation to which the message belongs.
        callback - The callback for retrieving historical messages, ordered from newest to oldest.
        Since:

        5.1.1

      • deleteMessages

         abstract void deleteMessages(ConversationType conversationType, String targetId, String channelId, IRongCoreCallback.ResultCallback<Boolean> callback)

        Deletes all messages in a specific conversation.

        This API deletes all messages in the database for the specified conversation and also cleans up the database space to reduce storage usage.

        Parameters:
        conversationType - The type of conversation.
        targetId - The ID of the conversation.
        channelId - The business identifier of the conversation to which the messages belong.
        callback - Callback indicating whether the deletion was successful.
        Since:

        5.1.1

      • deleteRemoteMessages

         abstract void deleteRemoteMessages(ConversationType conversationType, String targetId, String channelId, Array<Message> messages, IRongCoreCallback.OperationCallback callback)

        Batch deletes specified remote messages in a conversation (also deletes corresponding local messages).

        A single batch operation only supports deleting messages from the same conversation. Ensure all messages in the list belong to the same conversation. A maximum of 100 messages can be deleted at once.

        Note: Not supported for chatrooms!

        Versions below 5.6.9 do not support ultra group conversation types. Support for ultra group conversation types starts from version 5.6.9.

        Parameters:
        conversationType - The conversation type.
        targetId - The conversation ID.
        channelId - The business identifier of the conversation to which the messages belong.
        messages - The array of messages to delete.
        callback - Callback indicating whether the deletion was successful.
        Since:

        5.1.1

      • clearMessages

         abstract void clearMessages(ConversationType conversationType, String targetId, String channelId, IRongCoreCallback.ResultCallback<Boolean> callback)

        Deletes all messages in a specified conversation.

        Note: Chatrooms are not supported!

        Parameters:
        conversationType - The type of conversation.
        targetId - The ID of the conversation.
        channelId - The business identifier of the conversation to which the messages belong.
        callback - Callback indicating whether the operation was successful.
        Since:

        5.1.1

      • clearMessages

         abstract void clearMessages(List<ClearMessageOption> clearMessageOptions, IRongCoreCallback.ResultCallback<Boolean> callback)

        Asynchronously deletes all local database messages in the specified conversations that were sent on or before the given timestamp.

        This method removes message records in the database for conversations that were sent on or before the specified timestamp. A timestamp of 0 clears all messages.

        Supported conversation types: one-to-one chat, group chat, chatroom, system message.

        Parameters:
        clearMessageOptions - The list of message deletion parameters, with a maximum of 20 entries.
        callback - Callback indicating whether the deletion was successful.
        Since:

        5.6.7

      • clearRemoteMessages

         abstract void clearRemoteMessages(List<ClearMessageOption> clearMessageOptions, boolean isDeleteLocal, IRongCoreCallback.OperationCallback callback)

        Asynchronously deletes all remote messages in the specified conversation on the server that were sent before or at the specified timestamp (local messages can also be deleted).

        Passing a timestamp of 0 clears all messages.

        Supported conversation types: one-to-one chat, group chat, chatroom, system message.

        Parameters:
        clearMessageOptions - List of message deletion parameters, with a maximum of 20 entries.
        isDeleteLocal - Indicates whether to delete local messages.
        callback - Callback to indicate whether the deletion was successful.
        Since:

        5.6.7

      • clearMessagesUnreadStatus

         abstract void clearMessagesUnreadStatus(ConversationType conversationType, String targetId, String channelId, IRongCoreCallback.ResultCallback<Boolean> callback)

        Clears the unread message count for a specific conversation.

        Note: Not supported for chatrooms and ultra groups.

        Parameters:
        conversationType - The type of conversation.
        targetId - The ID of the conversation.
        channelId - The business identifier of the conversation to which the message belongs.
        callback - Callback indicating whether the operation was successful.
        Since:

        5.1.1

      • getTextMessageDraft

         abstract void getTextMessageDraft(ConversationType conversationType, String targetId, String channelId, IRongCoreCallback.ResultCallback<String> callback)

        Retrieves draft information from the conversation.

        Parameters:
        conversationType - The type of the conversation.
        targetId - The ID of the conversation.
        channelId - The business identifier of the conversation to which the message belongs.
        callback - The callback to retrieve the draft text content.
        Since:

        5.1.1

      • saveTextMessageDraft

         abstract void saveTextMessageDraft(ConversationType conversationType, String targetId, String channelId, String content, IRongCoreCallback.ResultCallback<Boolean> callback)

        Save the draft information of a conversation.

        Parameters:
        conversationType - The type of conversation.
        targetId - The ID of the conversation.
        channelId - The business identifier of the conversation to which the message belongs.
        content - The text content of the draft.
        callback - Callback indicating whether the save operation was successful.
        Since:

        5.1.1

      • clearTextMessageDraft

         abstract void clearTextMessageDraft(ConversationType conversationType, String targetId, String channelId, IRongCoreCallback.ResultCallback<Boolean> callback)

        Deletes draft information in the specified conversation.

        Parameters:
        conversationType - The type of the conversation.
        targetId - The ID of the conversation.
        channelId - The business identifier of the conversation to which the message belongs.
        callback - Callback indicating whether the deletion was successful.
        Since:

        5.1.1

      • insertOutgoingMessage

         abstract void insertOutgoingMessage(ConversationType type, String targetId, String channelId, SentStatus sentStatus, MessageContent content, long sentTime, IRongCoreCallback.ResultCallback<Message> resultCallback)

        Inserts a message into the local conversation with the direction set to sent.

        This message is only inserted into the local conversation and will not be actually sent to the server or the recipient.

        The inserted message must be a persisted message, i.e., ISPERSISTED, otherwise it will trigger the callback RC_INVALID_PARAMETER_MSG_TAG.

        Parameters:
        type - The type of the conversation.
        targetId - The ID of the conversation.
        channelId - The business identifier of the conversation to which the message belongs.
        sentStatus - The sending status Message.
        content - The content of the message.
        sentTime - The sending time of the message getSentTime.
        resultCallback - The callback to obtain the message sending entity.
        Since:

        5.1.1

      • insertOutgoingMessage

         abstract void insertOutgoingMessage(ConversationType type, String targetId, String channelId, boolean canIncludeExpansion, SentStatus sentStatus, MessageContent content, long sentTime, IRongCoreCallback.ResultCallback<Message> resultCallback)
        Since:

        5.2.4

      • insertIncomingMessage

         abstract void insertIncomingMessage(ConversationType type, String targetId, String channelId, String senderUserId, ReceivedStatus receivedStatus, MessageContent content, long sentTime, IRongCoreCallback.ResultCallback<Message> resultCallback)

        Inserts a message into the local conversation with the direction set as received.

        This message is only inserted into the local conversation and will not be actually sent to the server or the other party. The inserted message must be a persisted message, i.e., ISPERSISTED, otherwise the callback RC_INVALID_PARAMETER_MSG_TAG will be triggered.

        Parameters:
        type - The type of the conversation.
        targetId - The ID of the conversation.
        channelId - The business identifier of the conversation to which the message belongs.
        senderUserId - The ID of the sender.
        receivedStatus - The received status Message.
        content - The content of the message.
        sentTime - The sent time of the message getSentTime.
        resultCallback - The callback to obtain the message sending entity.
        Since:

        5.1.1

      • sendMessage

         abstract void sendMessage(ConversationType type, String targetId, String channelId, MessageContent content, String pushContent, String pushData, IRongCoreCallback.ISendMessageCallback callback)

        Sends a message based on the conversation type.

        The message status and message body are returned through the methods in . Note: The number of messages sent per second cannot exceed 5.

        Parameters:
        type - The conversation type.
        targetId - The conversation ID.
        channelId - The business identifier of the conversation to which the message belongs.
        content - The message content, such as io.rong.message.
        pushContent - When sending a remote push notification, this field will be displayed in the notification bar.
        pushData - Additional information for remote push notifications.
        callback - The callback for sending the message.
        Since:

        5.1.1

      • sendDirectionalMessage

         abstract void sendDirectionalMessage(ConversationType type, String targetId, String channelId, MessageContent content, Array<String> userIds, String pushContent, String pushData, SendMessageOption option, IRongCoreCallback.ISendMessageCallback callback)

        Send a targeted message.

        This method is used to send a message to specific users in a group or ultra group. Other users will not receive this message.

        The message status and message body are returned through the methods in .

        This method can only send non-multimedia messages. For multimedia messages such as , io.rong.message.FileMessage, or other messages inherited from io.rong.message.MediaMessageContent, use sendDirectionalMessage

        If you are using IMLib, you can use this method to send targeted messages. If you are using IMKit, please use the method of the same name in RongIM to send targeted messages; otherwise, the UI will not be updated automatically.

        Starting from version 5.6.9, ultra group conversation types are supported.

        Parameters:
        type - The conversation type.
        targetId - The conversation ID.
        channelId - The business identifier of the conversation to which the message belongs.
        content - The message content, such as io.rong.message.
        userIds - The list of users in the discussion group or group conversation who will receive this message.
        pushContent - When a remote push notification is sent, this field will be displayed in the notification bar.
        pushData - Additional information for remote push notifications.
        option - Additional options for sending the message.
        callback - The callback for sending the message.
        Since:

        5.1.1

      • sendDirectionalMessage

         abstract void sendDirectionalMessage(Message message, Array<String> userIds, String pushContent, String pushData, SendMessageOption option, IRongCoreCallback.ISendMessageCallback callback)

        Sends a targeted message.

        This method is used to send a message to specific users within a group or ultra group, while other users will not receive this message.

        The message status and message body are returned through the methods in .

        This method can only send non-multimedia messages. For multimedia messages such as , io.rong.message.FileMessage, or any other messages that inherit from io.rong.message.MediaMessageContent, use sendDirectionalMessage

        If you are using IMLib, you can use this method to send targeted messages. If you are using IMKit, use the method with the same name in RongIM to send targeted messages; otherwise, the UI will not be automatically updated.

        Starting from version 5.6.9, ultra group conversation types are supported.

        Parameters:
        message - The message object to be sent.
        userIds - The list of users in the discussion group or group who will receive this message.
        pushContent - When a remote push notification is sent, this field will be displayed in the notification bar.
        pushData - Additional information for remote push notifications.
        option - Additional options for sending the message.
        callback - The callback for sending the message.
        Since:

        5.2.3

      • sendDirectionalMediaMessage

         abstract void sendDirectionalMediaMessage(Message message, Array<String> userIds, String pushContent, String pushData, IRongCoreCallback.ISendMediaMessageCallback callback)

        Sends a targeted multimedia message.

        Sends a message to specific users in a conversation, while other users in the conversation will not receive the message. Before sending, construct the Message entity, where the content must be a multimedia message. For example: ImageMessage, FileMessage, or other messages that inherit from MediaMessageContent.

        Starting from version 5.6.9, ultra group conversation types are supported.

        Parameters:
        message - The message entity to be sent.
        userIds - An array of target recipient IDs.
        pushContent - When sending a remote push notification, this field will be displayed in the notification bar.
        pushData - Additional information for remote push notifications.
        callback - The callback for sending the message .
        Since:

        5.2.4

      • sendImageMessage

         abstract void sendImageMessage(ConversationType type, String targetId, String channelId, MessageContent content, String pushContent, String pushData, IRongCoreCallback.SendImageMessageCallback callback)

        Sends an image message.

        If you are using IMLib, you can use this method to send an image message.

        If you are using IMKit, please use the method with the same name in RongIM to send an image message; otherwise, the UI will not be automatically updated.

        Parameters:
        type - The conversation type.
        targetId - The conversation ID.
        channelId - The business identifier of the conversation to which the message belongs.
        content - The message content, such as TextMessage, .
        pushContent - When sending a remote push notification, this field will be displayed in the notification bar.
        pushData - Additional information for remote push notifications.
        callback - The callback for sending the message.
        Since:

        5.1.1

      • downloadMedia

         abstract void downloadMedia(ConversationType conversationType, String targetId, String channelId, IRongCoreEnum.MediaType mediaType, String imageUrl, IRongCoreCallback.DownloadMediaCallback callback)

        Downloads multimedia files.

        If the file exists in the local cache, it will be retrieved directly from the cache. Otherwise, it will be downloaded from the server.

        Parameters:
        conversationType - The type of conversation.
        targetId - The ID of the conversation.
        channelId - The business identifier of the conversation to which the message belongs.
        mediaType - The type of file.
        imageUrl - The URL of the file.
        callback - The callback for downloading the file.
        Since:

        5.1.1

      • getConversationNotificationStatus

         abstract void getConversationNotificationStatus(ConversationType conversationType, String targetId, String channelId, IRongCoreCallback.ResultCallback<ConversationNotificationStatus> callback)

        Retrieves the message reminder status of a conversation.

        Note: Not supported for chatrooms!

        Parameters:
        conversationType - The type of conversation.
        targetId - The ID of the conversation.
        callback - The callback for retrieving the message reminder status.
        Since:

        5.1.1

      • setConversationNotificationStatus

         abstract void setConversationNotificationStatus(ConversationType conversationType, String targetId, String channelId, ConversationNotificationStatus notificationStatus, IRongCoreCallback.ResultCallback<ConversationNotificationStatus> callback)

        Sets the message notification status for a conversation.

        Note: Chatrooms are not supported!

        Parameters:
        conversationType - The type of conversation.
        targetId - The ID of the conversation.
        channelId - The business identifier of the conversation to which the message belongs.
        notificationStatus - The message notification status to set for the conversation .
        callback - The callback for setting the status.
        Since:

        5.1.1

      • clearConversations

         abstract void clearConversations(IRongCoreCallback.ResultCallback<Boolean> callback, String channelId, Array<ConversationType> conversationTypes)

        Clears all conversations and conversation information of the specified conversation types. (Not supported for ultra groups)

        Parameters:
        callback - Callback indicating whether the operation was successful.
        channelId - Business identifier of the conversation to which the message belongs.
        conversationTypes - List of conversation types to be cleared.
        Since:

        5.1.1

      • getTypingUserListFromConversation

         abstract Collection<TypingStatus> getTypingUserListFromConversation(ConversationType conversationType, String targetId, String channelId)

        Get the list of users currently typing in the conversation

        Parameters:
        conversationType - Conversation type
        targetId - Conversation ID
        channelId - Business identifier of the conversation to which the message belongs
        Returns:

        List of users currently typing in the conversation

        Since:

        5.1.1

      • sendTypingStatus

         abstract void sendTypingStatus(ConversationType conversationType, String targetId, String channelId, String typingContentType)

        Sends a typing status to the conversation. Currently, only one-to-one chat is supported.

        Parameters:
        conversationType - The type of the conversation
        targetId - The ID of the conversation
        channelId - The business identifier of the conversation to which the message belongs
        typingContentType - The type name of the message being typed.
        Since:

        5.1.1

      • sendReadReceiptMessage

         abstract void sendReadReceiptMessage(ConversationType conversationType, String targetId, String channelId, long timestamp)

        Sends a read receipt for messages in a specific conversation.

        For IMLib, you can register a listener using setReadReceiptListener; for IMKit, simply set rc_read_receipt to true in rc_config.xml.

        Parameters:
        conversationType - The type of conversation (only applicable to PRIVATE and ENCRYPTED types).
        targetId - The ID of the conversation.
        channelId - The business identifier of the conversation to which the message belongs.
        timestamp - The timestamp of the last read message in the conversation getSentTime.
        Since:

        5.1.1

      • sendReadReceiptMessage

         abstract void sendReadReceiptMessage(ConversationType conversationType, String targetId, String channelId, long timestamp, IRongCoreCallback.ISendMessageCallback callback)

        Sends a read receipt for messages in a specific conversation.

        For IMLib, you can register a listener using setReadReceiptListener; for IMKit, directly set rc_read_receipt to true in rc_config.xml.

        Parameters:
        conversationType - The type of conversation (only applicable to PRIVATE and ENCRYPTED types)
        targetId - The ID of the conversation
        channelId - The business identifier of the conversation to which the message belongs
        timestamp - The timestamp of the last read message in the conversation getSentTime
        callback - The callback for sending the read receipt message
        Since:

        5.1.1

      • getUnreadMentionedMessages

         abstract void getUnreadMentionedMessages(ConversationType conversationType, String targetId, String channelId, IRongCoreCallback.ResultCallback<List<Message>> callback)

        Fetches unread @ mentions in a conversation.

        Parameters:
        conversationType - The type of conversation.
        targetId - The ID of the conversation.
        channelId - The business identifier of the conversation to which the message belongs.
        callback - Callback to retrieve unread @ mentions.
        Since:

        5.1.1

      • clearMessagesUnreadStatus

         abstract void clearMessagesUnreadStatus(ConversationType conversationType, String targetId, String channelId, long timestamp, IRongCoreCallback.OperationCallback callback)

        Clears the unread message count for a specific conversation.

        Note: Not supported for chatrooms or ultra groups.

        Parameters:
        conversationType - The type of conversation.
        targetId - The ID of the conversation.
        channelId - The business identifier of the conversation to which the message belongs.
        timestamp - The timestamp of the last read message in the conversation.
        callback - Callback indicating whether the operation was successful.
        Since:

        5.1.1

      • sendReadReceiptResponse

         abstract void sendReadReceiptResponse(ConversationType type, String targetId, String channelId, List<Message> messageList, IRongCoreCallback.OperationCallback callback)

        Send read receipt (only supported for groups and discussion groups).

        Parameters:
        type - Conversation type
        targetId - Conversation ID
        channelId - Business identifier for the conversation to which the message belongs
        messageList - List of messages in the conversation for which read receipts need to be sent
        callback - Callback function
        Since:

        5.1.1

      • syncConversationReadStatus

         abstract void syncConversationReadStatus(ConversationType type, String targetId, String channelId, long timestamp, IRongCoreCallback.OperationCallback callback)

        Synchronizes the read status of a conversation.

        Parameters:
        type - The type of the conversation
        targetId - The ID of the conversation
        channelId - The business identifier of the conversation to which the message belongs
        timestamp - The timestamp of the last read message in the conversation getSentTime
        callback - The callback function
        Since:

        5.1.1

      • searchConversations

         abstract void searchConversations(String keyword, Array<ConversationType> conversationTypes, String channelId, Array<String> objectNames, IRongCoreCallback.ResultCallback<List<SearchConversationResult>> resultCallback)

        Search conversations based on keywords.

        This method quickly returns a list of matching conversations, including the count of matched messages within each conversation. Use getMatchCount to retrieve the count.

        Note: To enable custom messages to be searchable, implement the getSearchableWord method in your custom message class.

        Parameters:
        keyword - The keyword to search for.
        conversationTypes - The types of conversations to search.
        channelId - The business identifier of the conversation to which the messages belong.
        objectNames - The types of messages to search for, e.g., RC:TxtMsg.
        resultCallback - Callback for search results.
        Since:

        5.1.1

      • searchMessages

         abstract void searchMessages(ConversationType conversationType, String targetId, String channelId, String keyword, int count, long beginTime, IRongCoreCallback.ResultCallback<List<Message>> resultCallback)

        Searches for messages in a specified conversation based on a keyword.

        Note: To make custom messages searchable, implement the getSearchableWord method in your custom message class. For ultra group conversations, only messages stored locally can be searched.

        Parameters:
        conversationType - The type of the specified conversation.
        targetId - The ID of the specified conversation.
        channelId - The business identifier of the conversation to which the message belongs.
        keyword - The keyword to search for.
        count - The number of search results to return.
        beginTime - Search for messages before this timestamp.
        resultCallback - Callback for search results.
        Since:

        5.1.1

      • searchMessages

         abstract void searchMessages(ConversationType conversationType, String targetId, String channelId, String keyword, long startTime, long endTime, int offset, int limit, IRongCoreCallback.ResultCallback<List<Message>> resultCallback)

        Searches for messages in a specified conversation within a given time range based on keywords.

        Note: To make custom messages searchable, implement the getSearchableWord method in your custom message class. For ultra group conversations, only locally stored messages can be searched.

        Parameters:
        conversationType - The specified conversation type.
        targetId - The specified conversation ID.
        channelId - The business identifier of the conversation to which the message belongs.
        keyword - The search keyword.
        startTime - The start time of the search range.
        endTime - The end time of the search range.
        offset - The offset for pagination.
        limit - The number of search results to return.
        resultCallback - Callback for search results.
        Since:

        5.1.2

      • searchMessages

         abstract void searchMessages(ConversationIdentifier conversationIdentifier, String keyword, Array<String> objectNameList, int limit, long startTime, IRongCoreCallback.ResultCallback<List<Message>> resultCallback)

        Searches for local historical messages of specified message types in a specific conversation based on keywords

        This method allows applications to search for messages in a specific conversation based on conditions such as keywords, object name lists, and time ranges. The search results will be returned via a callback.

        Parameters:
        conversationIdentifier - Conversation type and conversation ID
        keyword - Keyword, cannot be empty
        objectNameList - Array of message types, supports multiple entries (e.g.
        limit - Maximum number of queries [maximum 100, if exceeded, 100 will be used]
        startTime - Query messages before startTime (pass 0 to start searching from the latest message), unit: milliseconds
        resultCallback - Callback interface for search results.
        Since:

        5.8.1

      • searchMessagesByUser

         abstract void searchMessagesByUser(ConversationType conversationType, String targetId, String channelId, String userId, int count, long beginTime, IRongCoreCallback.ResultCallback<List<Message>> resultCallback)

        Searches for messages in a specified conversation based on user ID.

        Note: To make custom messages searchable, the getSearchableWord method must be implemented in the custom message. For ultra group conversations, only messages stored locally can be searched.

        Parameters:
        conversationType - The specified conversation type.
        targetId - The specified conversation ID.
        channelId - The business identifier of the conversation to which the message belongs.
        userId - The user ID.
        count - The number of search results to return 0 < count <= 100.
        beginTime - The start time for the search query.
        resultCallback - Callback for search results.
        Since:

        5.1.1

      • searchMessagesForChannels

         abstract void searchMessagesForChannels(ConversationType conversationType, String targetId, Array<String> channelIds, String keyword, long startTime, int limit, IRongCoreCallback.ResultCallback<List<Message>> resultCallback)

        Searches for messages in a specified conversation based on user ID, conversation business identifier, keyword, etc.

        Note: To ensure that custom messages can be searched, implement the getSearchableWord method in your custom message.

        Parameters:
        conversationType - The specified conversation type.
        targetId - The specified conversation ID.
        channelIds - The business identifier of the conversation to which the messages belong.
        keyword - The keyword.
        startTime - The start time for the query.
        limit - The number of search results to return 0 < limit <= 100.
        resultCallback - The callback for search results.
        Since:

        5.6.2

      • searchMessagesByUserForChannels

         abstract void searchMessagesByUserForChannels(ConversationType conversationType, String targetId, Array<String> channelIds, String userId, long startTime, int limit, IRongCoreCallback.ResultCallback<List<Message>> resultCallback)

        Searches for messages in a specified conversation based on conversation ID, business identifier, user ID, etc.

        Note: To make custom messages searchable, implement the getSearchableWord method in the custom message.

        Parameters:
        conversationType - Specifies the conversation type.
        targetId - Specifies the conversation ID.
        channelIds - The business identifier of the conversation to which the messages belong.
        userId - The user ID.
        startTime - The start time for the query.
        limit - The number of search results to return 0 < limit <= 100.
        resultCallback - Callback for search results.
        Since:

        5.6.2

      • searchMessagesByUserForAllChannel

         abstract void searchMessagesByUserForAllChannel(ConversationType conversationType, String targetId, String userId, long startTime, int limit, IRongCoreCallback.ResultCallback<List<Message>> resultCallback)

        Search for messages in a specified conversation based on conversation ID, user ID, etc. (Includes all Channel IDs)

        Note: To ensure that custom messages can also be searched, implement the getSearchableWord method in your custom message.

        Parameters:
        conversationType - The specified conversation type.
        targetId - The specified conversation ID.
        userId - The user ID.
        startTime - The start time for the query.
        limit - The number of search results to return 0 < limit <= 100.
        resultCallback - The callback for search results.
        Since:

        5.6.2

      • getHistoryMessages

         abstract void getHistoryMessages(ConversationType conversationType, String targetId, String channelId, long sentTime, int before, int after, IRongCoreCallback.ResultCallback<List<Message>> resultCallback)

        Searches for a specified number of messages before before and after after a specified message in a conversation.

        The returned message list will include the specified message. The messages are ordered from newest to oldest.

        This method only retrieves messages from the local database.

        Note: Starting from version 5.4.4, this method supports ultra group type. Ultra groups do not receive offline messages. Calling this method for ultra groups may result in missing messages. Use the missing message interface to retrieve ultra group messages.

        Parameters:
        conversationType - The specified conversation type.
        targetId - The specified conversation ID.
        channelId - The business identifier of the conversation to which the message belongs.
        sentTime - The sending time of the specified message, which cannot be 0.
        before - The number of messages before the specified message.
        after - The number of messages after the specified message.
        resultCallback - The callback for search results.
        Since:

        5.1.1

      • getTheFirstUnreadMessage

         abstract void getTheFirstUnreadMessage(ConversationType conversationType, String targetId, String channelId, IRongCoreCallback.ResultCallback<Message> callback)

        Retrieves the first unread message.

        Parameters:
        conversationType - The type of conversation.
        targetId - The ID of the conversation.
        channelId - The business identifier of the conversation to which the message belongs.
        callback - The callback function.
        Since:

        5.1.1

      • getMessages

         abstract void getMessages(ConversationType conversationType, String targetId, String channelId, HistoryMessageOption historyMessageOption, IRongCoreCallback.IGetMessageCallback callback)

        Retrieves the historical messages of a specified conversation.

        This method first attempts to retrieve historical messages from the local storage. If there are missing messages locally, it will synchronize the missing parts from the server. If the synchronization from the server fails, a non-zero errorCode will be returned, and the locally available messages will be returned via the callback. The historical message cloud storage feature must be enabled.

        Parameters:
        conversationType - The type of the conversation.
        targetId - The ID of the conversation.
        channelId - The business identifier of the conversation to which the message belongs.
        historyMessageOption - HistoryMessageOption
        callback - The callback.
        Since:

        5.1.2

      • getMessages

         abstract void getMessages(ConversationType conversationType, String targetId, String channelId, HistoryMessageOption historyMessageOption, IRongCoreCallback.IGetMessageCallbackEx getMessageCallback)

        Fetches historical messages for a specified conversation.

        This method first retrieves historical messages from the local storage. If there are missing messages locally, it synchronizes the missing parts from the server. If the synchronization from the server fails, it returns a non-zero errorCode and calls back with the messages that could be retrieved locally. The historical message cloud storage feature must be enabled.

        Parameters:
        conversationType - The type of conversation.
        targetId - The ID of the conversation.
        channelId - The business identifier of the conversation to which the message belongs.
        historyMessageOption - HistoryMessageOption
        getMessageCallback - The callback.
        Since:

        5.1.2

      • getConversationTopStatus

         abstract void getConversationTopStatus(String targetId, ConversationType conversationType, String channelId, IRongCoreCallback.ResultCallback<Boolean> callback)

        Retrieves the pinned status of a conversation. Ensure to set the setConversationStatusListener listener to update the pinned status in the onConversationTagChanged callback, ensuring the accuracy of the conversation's pinned status.

        This method reads the pinned status of the conversation from the local database.

        Parameters:
        targetId - The ID of the conversation.
        conversationType - The type of the conversation.
        channelId - The business identifier of the conversation to which the message belongs.
        callback - The callback for the pinned status result.
        Since:

        5.1.5

      • getUnreadCount

         abstract void getUnreadCount(String targetId, ConversationType conversationType, Array<String> objectNames, String channelId, IRongCoreCallback.ResultCallback<Integer> callback)

        Retrieves the count of unread messages of specified types in a given conversation (excluding chatroom conversations).

        Parameters:
        targetId - The target ID of the conversation.
        conversationType - The type of the conversation.
        objectNames - An array of message types.
        channelId - The business identifier of the conversation to which the messages belong.
        callback - Callback for the unread count result.
        Since:

        5.1.5

      • getPrivateMessageDeliverTime

         abstract void getPrivateMessageDeliverTime(String uid, String channelId, IRongCoreCallback.ResultCallback<Long> callback)

        Get the delivery time of a specific message in a one-to-one chat

        Parameters:
        uid - The message UID getUId
        channelId - The business identifier of the conversation to which the message belongs.
        callback - Callback to retrieve the delivery time of the message in a one-to-one chat.
        Since:

        SDK 5.1.7

      • getGroupMessageDeliverList

         abstract void getGroupMessageDeliverList(String uid, String targetId, String channelId, IRongCoreListener.IGetGroupMessageDeliverListCallback callback)

        Get the delivery list of group messages (only supports group messages)

        Only queries messages in the local database where the UID exists, the sending direction is SEND, and the recipient has received the message.

        Parameters:
        uid - The message UID getUId
        targetId - The group ID
        channelId - The business identifier of the conversation to which the message belongs
        callback - The callback for retrieving the group message delivery list
        Since:

        SDK 5.1.7

      • getMessageByUid

         abstract void getMessageByUid(String uid, IRongCoreCallback.ResultCallback<Message> callback)

        Retrieves the message entity by its globally unique ID.

        Parameters:
        uid - The globally unique ID (server message unique ID).
        callback - The callback for retrieving the message.
        Since:

        5.1.7

      • getUltraGroupUnreadMentionedCount

         abstract void getUltraGroupUnreadMentionedCount(String targetId, IRongCoreCallback.ResultCallback<Integer> callback)

        Retrieves the count of unread @ mentions in an ultra group conversation.

        Note: This method only supports ultra group conversation types!

        Parameters:
        targetId - The conversation ID
        callback - Callback for the count of unread @ mentions in the ultra group conversation
        Since:

        SDK 5.1.8

      • deleteUltraGroupMessagesForAllChannel

         abstract void deleteUltraGroupMessagesForAllChannel(String targetId, long timestamp, IRongCoreCallback.ResultCallback<Boolean> callback)

        Deletes all local messages before a specific timestamp for a given channel

        Parameters:
        targetId - The conversation ID
        timestamp - The timestamp
        callback - Callback triggered after deleting all local messages before the specified timestamp
        Since:

        5.2.0

      • deleteUltraGroupMessages

         abstract void deleteUltraGroupMessages(String targetId, String channelId, long timestamp, IRongCoreCallback.ResultCallback<Boolean> callback)

        Deletes local messages before a specific time for a particular channel.

        Parameters:
        targetId - The conversation ID.
        channelId - The business identifier of the conversation to which the messages belong.
        timestamp - The timestamp.
        callback - Callback for deleting local messages before the specified time for all channels.
        Since:

        5.2.0

      • deleteRemoteUltraGroupMessages

         abstract void deleteRemoteUltraGroupMessages(String targetId, String channelId, long timestamp, IRongCoreCallback.OperationCallback callback)

        Deletes messages before a specific timestamp in a specific channel on the server

        Parameters:
        targetId - The conversation ID
        channelId - The business identifier of the conversation to which the messages belong
        timestamp - The timestamp
        callback - Callback for deleting messages before a specific timestamp in a specific channel on the server
        Since:

        5.2.0

      • modifyUltraGroupMessage

         abstract void modifyUltraGroupMessage(String msgUid, MessageContent content, IRongCoreCallback.OperationCallback callback)

        Modify a message

        Note: This method can only modify messages of the same type within the same channel, and only messages sent by the user can be modified.

        Parameters:
        msgUid - Message UID
        content - MessageContent
        callback - Callback for message modification
        Since:

        5.2.0

      • syncUltraGroupReadStatus

         abstract void syncUltraGroupReadStatus(String targetId, String channelId, long timestamp, IRongCoreCallback.OperationCallback callback)

        Report the read timestamp of an ultra group

        Parameters:
        targetId - Conversation ID
        channelId - Business identifier of the conversation to which the message belongs
        timestamp - Read timestamp
        callback - Callback for reporting the read timestamp of the ultra group
        Since:

        5.2.0

      • updateUltraGroupMessageExpansion

         abstract void updateUltraGroupMessageExpansion(Map<String, String> expansion, String messageUId, IRongCoreCallback.OperationCallback callback)

        Update the extension information of an ultra group message

        Each message can carry a maximum of 300 key-value pairs of extension information. A single update can set a maximum of 20 key-value pairs.

        Parameters:
        expansion - The key-value pairs of message extension information to be updated, of type HashMap.
        messageUId - The messageUId of the message
        callback - Callback for updating the extension information
        Since:

        5.2.0

      • removeUltraGroupMessageExpansion

         abstract void removeUltraGroupMessageExpansion(String messageUId, List<String> keyArray, IRongCoreCallback.OperationCallback callback)

        Deletes specific key-value pairs from the extension information of an ultra group message

        Parameters:
        messageUId - The messageUId of the message
        keyArray - List of keys to be deleted from the message extension information, of type ArrayList
        callback - Callback for deleting message extension information
        Since:

        5.2.0

      • recallUltraGroupMessage

         abstract void recallUltraGroupMessage(Message message, IRongCoreCallback.ResultCallback<RecallNotificationMessage> callback)

        Recall ultra group message

        Parameters:
        message - The message to be recalled
        callback - onSuccess callback returns RecallNotificationMessage.
        Since:

        5.2.0

      • recallUltraGroupMessage

         abstract void recallUltraGroupMessage(Message message, boolean isDelete, IRongCoreCallback.ResultCallback<RecallNotificationMessage> callback)

        Recall ultra group message

        Parameters:
        message - The message to be recalled
        isDelete - Whether to delete the local message
        callback - onSuccess callback returns RecallNotificationMessage.
        Since:

        5.2.2

      • getUltraGroupConversationListForAllChannel

         abstract void getUltraGroupConversationListForAllChannel(IRongCoreCallback.ResultCallback<List<Conversation>> callback)

        Retrieves the local conversation list of the current user for ultra groups. This method returns a list of conversations of the following types: one-to-one chat, group, discussion group, and system conversation.

        This method reads the conversation list from the local database. The returned conversation list is sorted by time in ascending order. If there are pinned conversations, they will appear at the top of the list. If you need to retrieve conversation lists of other types, you can use getConversationList}.This method must be called after the database connection is opened, as indicated by the OnDatabaseOpened callback, IRongCoreCallback.ConnectCallback.

        Parameters:
        callback - The callback for retrieving the conversation list.
        Since:

        5.2.0

      • getConversationListForAllChannel

         abstract void getConversationListForAllChannel(ConversationType conversationType, String targetId, IRongCoreCallback.ResultCallback<List<Conversation>> callback)

        Retrieves the conversation list of all channels under a specific conversation (supports one-to-one chat, group chat, and ultra group, but not chatroom).

        Parameters:
        conversationType - The type of conversation
        targetId - The ID of the conversation
        callback - Callback for retrieving the conversation list of all channels under a specific conversation
        Since:

        5.2.0

      • setNotificationQuietHoursLevel

         abstract void setNotificationQuietHoursLevel(NotificationQuietHoursSetting setting, IRongCoreCallback.OperationCallback callback)

        设置消息通知免打扰时间。

        Parameters:
        setting - 消息通知免打扰时间设置。
        callback - 消息通知免打扰时间回调。
        Since:

        5.14.0。

      • setConversationChannelNotificationLevel

         abstract void setConversationChannelNotificationLevel(ConversationType conversationType, String targetId, String channelId, IRongCoreEnum.PushNotificationLevel level, IRongCoreCallback.OperationCallback callback)

        Sets the message reminder status for a conversation. To cancel the setting, call this method and pass PUSH_NOTIFICATION_LEVEL_ALL_MESSAGE as the level parameter.

        Note: Not supported for chatrooms!

        Note: For ultra groups, this API is used to set the Do Not Disturb status for specific channels.

        Parameters:
        conversationType - The type of conversation.
        targetId - The ID of the conversation.
        channelId - The business identifier of the conversation to which the message belongs.
        level - The message reminder level to set for the conversation.
        callback - The callback for the setting status.
        Since:

        5.2.2

      • setConversationsNotificationLevel

         abstract void setConversationsNotificationLevel(List<ConversationIdentifier> conversationIdentifiers, IRongCoreEnum.PushNotificationLevel level, IRongCoreCallback.OperationCallback callback)

        Asynchronously batch sets the message notification status for conversations.

        To cancel the setting, call this method with PUSH_NOTIFICATION_LEVEL_ALL_MESSAGE passed as the level parameter.

        Note: Not supported for chatrooms!

        Note: For ultra groups, this interface is used to set the Do Not Disturb level for specific channels.

        Parameters:
        conversationIdentifiers - List of conversation identifiers, with a maximum count of 20.
        level - The message notification level to be set for the conversations.
        callback - The callback result.
        Since:

        5.6.7

      • setConversationNotificationLevel

         abstract void setConversationNotificationLevel(ConversationType conversationType, String targetId, IRongCoreEnum.PushNotificationLevel level, IRongCoreCallback.OperationCallback callback)

        Specifies the Do Not Disturb settings for a conversation.

        Note: When this API is called for an ultra group, it sets the Do Not Disturb level for the channel with an empty channelId. It does not mute all channels under the entire ultra group conversation.

        Parameters:
        conversationType - The type of conversation.
        targetId - The ID of the conversation.
        level - The message reminder level for the conversation.
        callback - The callback for the setting status.
        Since:

        5.2.2

      • setConversationTypeNotificationLevel

         abstract void setConversationTypeNotificationLevel(ConversationType conversationType, IRongCoreEnum.PushNotificationLevel level, IRongCoreCallback.OperationCallback callback)

        Specifies Do Not Disturb settings for a specific conversation type

        Configures Do Not Disturb settings for specific conversation types. Supported types include: one-to-one chat, group chat, ultra group, and system conversation.

        Parameters:
        conversationType - The conversation type.
        level - The message notification level for the conversation.
        callback - Callback for the setting status.
        Since:

        5.2.2

      • getUltraGroupUnreadCount

         abstract void getUltraGroupUnreadCount(String targetId, IRongCoreCallback.ResultCallback<Integer> callback)

        Get the total count of unread messages across all channels in a specified ultra group

        Parameters:
        targetId - The conversation ID
        callback - The callback for retrieving the total count of unread messages across all channels in the specified ultra group
        Since:

        5.2.2

      • getUltraGroupAllUnreadCount

         abstract void getUltraGroupAllUnreadCount(IRongCoreCallback.ResultCallback<Integer> callback)

        Retrieves the count of all unread messages for ultra group conversation types.

        Parameters:
        callback - Callback for retrieving the count of all unread messages for ultra group conversation types.
        Since:

        5.2.2

      • getUnreadCount

         abstract void getUnreadCount(List<ConversationType> conversationTypes, List<IRongCoreEnum.PushNotificationLevel> levels, IRongCoreCallback.ResultCallback<Integer> callback)

        Get the count of unread messages in conversations

        Parameters:
        conversationTypes - List of conversation types: [one-to-one chat, group chat, ultra group]
        levels - List of Do Not Disturb levels [PushNotificationLevel]
        callback - Callback for retrieving the count of unread messages in conversations
        Since:

        5.2.5

      • getUnreadMentionedCount

         abstract void getUnreadMentionedCount(List<ConversationType> conversationTypes, List<IRongCoreEnum.PushNotificationLevel> levels, IRongCoreCallback.ResultCallback<Integer> callback)

        Get the count of unread @ mentions in conversations

        Parameters:
        conversationTypes - List of conversation types: [group chat, ultra group]
        levels - List of Do Not Disturb levels [PushNotificationLevel]
        callback - Callback for getting the count of unread @ mentions
        Since:

        5.2.5

      • getUltraGroupUnreadCount

         abstract void getUltraGroupUnreadCount(String targetId, List<IRongCoreEnum.PushNotificationLevel> levels, IRongCoreCallback.ResultCallback<Integer> callback)

        Retrieves the count of unread messages for a specified ultra group conversation (including all channels).

        Parameters:
        targetId - The conversation ID of the ultra group.
        levels - The list of Do Not Disturb levels [PushNotificationLevel].
        callback - Callback for retrieving the count of unread messages for the specified ultra group conversation (including all channels).
        Since:

        5.2.5

      • getUltraGroupUnreadMentionedCount

         abstract void getUltraGroupUnreadMentionedCount(String targetId, List<IRongCoreEnum.PushNotificationLevel> levels, IRongCoreCallback.ResultCallback<Integer> callback)

        Retrieves the count of unread @ messages for a specified ultra group conversation (including all channels).

        Parameters:
        targetId - The conversation ID of the ultra group.
        levels - A list of Do Not Disturb levels [PushNotificationLevel].
        callback - Callback for retrieving the count of unread @ messages for the specified ultra group conversation (including all channels).
        Since:

        5.2.5

      • getUltraGroupUnreadMentionedDigests

         abstract void getUltraGroupUnreadMentionedDigests(String targetId, String channelId, long sendTime, int count, IRongCoreCallback.ResultCallback<List<MessageDigestInfo>> callback)

        Fetches the list of unread mention message digests for ultra group conversations.

        Parameters:
        targetId - The ID of the ultra group conversation.
        channelId - The business identifier of the conversation to which the message belongs.
        sendTime - The timestamp when the message was sent [0 indicates querying from the first message].
        count - The number of messages to query [0 - 50].
        callback - The callback for fetching the list of unread mention message digests for ultra group conversations.
        Since:

        5.2.5

      • getBatchLocalMessages

         abstract void getBatchLocalMessages(ConversationType conversationType, String targetId, String channelId, List<String> messageUIDs, IRongCoreCallback.IGetMessagesByUIDsCallback callback)
        Parameters:
        conversationType - Specifies the conversation type, supporting one-to-one chat, group chat, ultra group, and chatroom conversation types.
        targetId - Indicates the conversation ID.
        channelId - Represents the channel ID.
        messageUIDs - Specifies the list of message UIDs to retrieve, supporting up to 20 messages.
        callback - Indicates the result callback.
        Since:

        5.2.5.2 Batch retrieval of local messages.

      • getUltraGroupConversationUnreadInfoList

         abstract void getUltraGroupConversationUnreadInfoList(Array<String> targetIds, IRongCoreCallback.ResultCallback<List<ConversationUnreadInfo>> callback)

        Retrieves unread information for all channel conversations under each ultra group based on the provided TargetId array.

        Parameters:
        targetIds - Array of TargetIds for ultra group conversations, supporting up to 20 entries
        callback - Result callback
        Since:

        5.4.6

      • getUltraGroupMessageCountByTimeRange

         abstract void getUltraGroupMessageCountByTimeRange(String targetId, Array<String> channelIds, long startTime, long endTime, IRongCoreCallback.ResultCallback<Integer> callback)

        Retrieves the number of messages within a specified time range for a given ultra group. If the channel_id_list is empty, it retrieves the message count for all channel IDs.

        Parameters:
        targetId - The conversation ID
        channelIds - The list of channel IDs
        startTime - The start time
        endTime - The end time
        callback - The callback result
        Since:

        5.6.4

      • getMessageCountByTimeRange

         abstract void getMessageCountByTimeRange(String targetId, ConversationType conversationType, long startTime, long endTime, IRongCoreCallback.ResultCallback<Integer> callback)

        Retrieves the number of messages within a specified time range for a given conversation. For ultra groups, it retrieves the message count for all channel IDs.

        Parameters:
        targetId - The conversation ID
        conversationType - The conversation type, supporting one-to-one chat, group chat, ultra group, and chatroom conversation types
        startTime - The start time
        endTime - The end time
        callback - The callback result
        Since:

        5.6.4

      • sendReadReceiptMessageV4

         abstract void sendReadReceiptMessageV4(ConversationType conversationType, String targetId, String channelId, String startMessageUID, String endMessageUID, IRongCoreCallback.OperationCallback callback)

        Send read receipt v4 (supports one-to-one and group chat)

        Parameters:
        conversationType - Conversation type
        targetId - Conversation ID
        channelId - Channel ID, pass null for non-ultra groups
        startMessageUID - Start message UID for group chat read receipt, pass for one-to-one chat
        endMessageUID - UID of the last read message
        callback - Callback function
        Since:

        5.6.7

      • getMessageReadReceiptV4

         abstract void getMessageReadReceiptV4(String targetId, String channelId, String messageUID, IRongCoreCallback.ResultCallbackEx<Integer, Integer, List<GroupMessageReader>> callback)

        Get the list of users who have read the message (supports group chats)

        Parameters:
        targetId - Conversation ID
        channelId - Channel ID, pass null if it's not an ultra group
        messageUID - The message in the conversation that requires a read receipt
        callback - Callback function
        Since:

        5.6.7

      • removeRemoteConversations

         abstract void removeRemoteConversations(List<ConversationIdentifier> conversationIdentifiers, IRongCoreCallback.OperationCallback callback)

        Delete remote conversation list

        Parameters:
        conversationIdentifiers - List of conversation identifiers used to specify the conversations to be retrieved.
        callback - Callback function
      • setReadTimestamp

         abstract void setReadTimestamp(ConversationIdentifier conversationIdentifier, long timestamp, IRongCoreCallback.OperationCallback callback)

        Sets the read timestamp for a real-time conversation

        Parameters:
        conversationIdentifier - The conversation identifier used to specify the target conversation.
        timestamp - The read timestamp
        callback - The callback function