Package io.rong.imlib

Class RongCoreClient

  • All Implemented Interfaces:

    
    public abstract class RongCoreClient
    
                        

    获取会话中未读的 @ 消息。

    Since:

    5.2.5

    • Constructor Detail

      • RongCoreClient

        RongCoreClient()
    • Method Detail

      • init

         static void init(Context context)

        Initializes the SDK. This should be called only once globally within the application. It is recommended to call this method in the Application subclass.

        Parameters:
        context - The Context of the Application class.
        Since:

        5.0.0

      • init

         static void init(Context context, String appKey)

        Initializes the SDK. This should be called only once globally within the application, preferably in the Application subclass.

        Parameters:
        context - The Context of the Application class.
        appKey - The App Key obtained after creating an application on the RCdeveloper platform.
        Since:

        5.0.0

      • init

         static void init(Context context, String appKey, boolean enablePush)

        Initializes the SDK. This method should be called only once globally in the application, preferably in the Application subclass.

        Parameters:
        context - The Context of the Application class.
        appKey - The App Key obtained after creating an application on the RCdeveloper platform.
        enablePush - Specifies whether to enable push notification.
        Since:

        5.0.0

      • init

         static void init(Context context, String appKey, boolean enablePush, Boolean isMainProcess)

        Initializes the SDK. This should be called only once globally in the application. It is recommended to call this in the Application inherited class.

        Parameters:
        context - The Context of the Application class.
        appKey - The App Key obtained after creating an application on the RCDeveloper Platform.
        enablePush - Whether to enable push notifications.
        Since:

        5.1.3

      • init

         static void init(Context context, String appKey, InitOption option)

        Initializes the SDK. This should be called only once globally in the application.

        Parameters:
        context - The Context of the Application class.
        appKey - The App Key obtained after creating an application on the RCdeveloper platform.
        option - The configuration information required for initialization.
        Since:

        5.3.4

      • connect

         static RongCoreClient connect(String token, IRongCoreCallback.ConnectCallback connectCallback)

        Connects to the RCserver. This method should be called only once globally in the entire application and must be invoked after init. If you are using IMKit, please use the method of the same name in IMCenter to establish a connection with the RCserver instead of using this method.

        When this method is called, the SDK will continuously attempt to reconnect until one of the following two scenarios occurs: First, the connection is successful, and the onSuccess(userId) callback is triggered. Second, an error that the SDK cannot handle occurs (e.g., an invalid token), and the onError(errorCode) callback is triggered, after which no further reconnection attempts are made. If you do not want to keep retrying, you can use the connect(String, int, ConnectCallback) method and set a connection timeout limit (timeLimit). Once the connection is successful, the SDK will handle all reconnection processes. In case of a network disconnection, the SDK will continuously retry until the connection is re-established, without requiring any additional connection operations from you.

        Parameters:
        token - The user authentication token (Token) obtained from the server.
        connectCallback - The callback for the connection result.
        Returns:

        RongCoreClient An instance of the IM client core class.

        Since:

        5.0.0

      • connect

         static RongCoreClient connect(String token, int timeLimit, IRongCoreCallback.ConnectCallback connectCallback)

        Retrieves an instance of the IMLib interface class. This method must be called after initializing the SDK with the init method; otherwise, it returns null.

        Returns:

        An instance of the IMLib interface class.

        Since:

        5.0.0

      • getVersion

         static String getVersion()
        Since:

        5.2.1

      • getCommitId

         static String getCommitId()

        Retrieves the SDK commit pointer

        Since:

        5.4.0

      • setConnectionStatusListener

        @Deprecated() static void setConnectionStatusListener(IRongCoreListener.ConnectionStatusListener listener)

        Sets a listener for connection status changes.

        When the callback status is TOKEN_INCORRECT, you need to obtain the correct token and actively call connect. If using IMKit, use the method of the same name in RongIM setConnectionStatusListener.

        Parameters:
        listener - The listener for connection status changes.
        Since:

        5.0.0

      • addOnReceiveMessageListener

         static boolean addOnReceiveMessageListener(OnReceiveMessageWrapperListener listener)

        Adds a listener for the message received event. Note: It is recommended to set a global listener for the application lifecycle.

        Parameters:
        listener - The listener for receiving messages.
        Returns:

        Indicates whether the addition was successful.

        Since:

        5.1.5

      • removeOnReceiveMessageListener

         static boolean removeOnReceiveMessageListener(OnReceiveMessageWrapperListener listener)

        Removes the listener for message received events.

        Parameters:
        listener - The listener for receiving messages.
        Returns:

        Indicates whether the removal was successful.

        Since:

        5.1.5

      • setServerInfo

         static void setServerInfo(String naviServer, String fileServer)

        Sets the navigation server and media server addresses for private deployment.

        Supports setting addresses in the format of http://cn.xxx.com, https://cn.xxx.com, or cn.xxx.com. If cn.xxx.com is provided, the SDK will assemble it into the http:// protocol format. Multiple navigation addresses are supported and must be separated by semicolons (;). Note: This method must be used before init!

        This interface has the same effect as the naviServer and fileServer parameters passed in InitOption within init. Either method of setting will take effect.

        Parameters:
        naviServer - The navigation server address for private deployment.
        fileServer - The media server address for private deployment, i.e., the upload address for files and images.
        Since:

        5.0.0

      • setStatisticDomain

         static void setStatisticDomain(String domain)

        Configures the data upload URL (optional).

        By configuring this URL, the SDK will upload device-related information to the private cloud node during initialization. This affects the broadcast push functionality in the developer console. If private cloud customers do not configure this URL, clients will not receive push notifications sent from the console. Regular IM push notifications are not affected. Sets the data upload server URL. Supports setting URLs in the format of http://cn.xxx.com, https://cn.xxx.com, or cn.xxx.com. If set to cn.xxx.com, the SDK will assemble it into the http:// protocol format.

        Parameters:
        domain - The domain name
        Since:

        5.0.0

      • registerMessageType

        @Deprecated() static void registerMessageType(Class<out MessageContent> messageContentClass)

        Register custom message types

        Call this method after initialization and before connecting to register custom messages.

        Parameters:
        messageContentClass - The class of the custom message, which must inherit from .
        Since:

        5.0.0

      • registerMessageType

         static void registerMessageType(List<Class<out MessageContent>> messageContentClassList)

        Batch register custom message types

        Call this method to register custom messages after initialization and before connecting.

        Parameters:
        messageContentClassList - A list of custom message classes.
        Since:

        5.0.0

      • setTypingStatusListener

         static void setTypingStatusListener(IRongCoreListener.TypingStatusListener listener)

        Sets the typing status listener.

        When the typing status changes, the callback onTypingStatusChanged is triggered. For one-to-one chats, the listener is triggered once when the other party is typing, and once again when the other party stops typing, but the callback will return an empty list of typing users.

        Parameters:
        listener - The typing status listener
        Since:

        5.0.0

      • addConversationsToTag

         abstract void addConversationsToTag(String tagId, List<ConversationIdentifier> conversationIdentifierList, IRongCoreCallback.OperationCallback callback)

        Adds a conversation to a tag

        Parameters:
        tagId - The ID of the tag
        conversationIdentifierList - The list of conversations
        callback - Callback for adding a conversation to a tag
        Since:

        5.1.1

      • appOnStart

         abstract void appOnStart()

        Notifies the SDK that the application has returned to the foreground.

        Note: This method must be called after init. @Deprecated

        Since:

        5.0.0

      • batchInsertMessage

         abstract void batchInsertMessage(List<Message> messages, IRongCoreCallback.ResultCallback<Boolean> callback)

        Batch inserts received messages (these messages are only inserted into the local database and are not actually sent to the server or the other party). The following attributes of the Message will be stored in the database, while other attributes will be discarded: - conversationType: Conversation type - targetId: Conversation ID - messageDirection: Message direction - senderUserId: Sender ID - receivedStatus: Receipt status; if the message direction is inbound and message.getReceivedStatus().setRead() has not been called, the message is unread. - sentStatus: Sending status - content: Message content - sentTime: Message sending time (Unix timestamp in milliseconds, which affects message sorting) - extra: Additional fields of the Message

        This method does not support chatroom conversation types. Each batch can process up to 500 messages. If the batch exceeds 500 messages, it will return RC_INVALID_PARAMETER_MESSAGE_LIST. The unread count of the messages will be accumulated to the conversation's unread count.

        Parameters:
        messages - List of messages to be processed in batch
        callback - Callback
        Since:

        5.1.1

      • batchInsertMessage

         abstract void batchInsertMessage(List<Message> messages, boolean enableCheck, IRongCoreCallback.ResultCallback<Boolean> callback)

        Batch inserts received messages (these messages are only inserted into the local database and will not be sent to the server or the other party). The following attributes of the Message will be stored in the database, while other attributes will be discarded: - conversationType: Conversation type - targetId: Conversation ID - UId: Unique message ID - messageDirection: Message direction - senderUserId: Sender ID - receivedStatus: Receipt status; if the message direction is incoming and message.getReceivedStatus().setRead() has not been called, the message is unread. - sentStatus: Sending status - content: Message content - sentTime: Message sending time (Unix timestamp in milliseconds, which affects message sorting) - extra: Additional fields of the Message

        This method does not support chatroom conversation types. Each batch can process up to 500 messages. If the batch exceeds 500 messages, it will return RC_INVALID_PARAMETER_MESSAGE_LIST. The unread count of messages will be accumulated into the unread count of the conversation.

        Parameters:
        messages - List of messages to be processed in batch
        enableCheck - Whether message deduplication is required
        callback - Callback
        Since:

        5.3.5

      • cancelDownloadMediaMessage

         abstract void cancelDownloadMediaMessage(Message message, IRongCoreCallback.OperationCallback callback)

        Cancels the download of a multimedia message.

        Parameters:
        message - The multimedia file message.
        callback - The callback triggered when the download is canceled.
        Since:

        5.0.0

      • getPrivateDownloadToken

        @Deprecated() abstract void getPrivateDownloadToken(String fileName, IRongCoreCallback.ResultCallback<String> callback)

        This interface is only applicable for private cloud SDK calls. The current version is no longer supported. Private cloud users should use the new interface getMediaUploadAuthorInfo

        Parameters:
        fileName - The name of the file
        callback - Returns the authentication token
      • getMediaUploadAuthorInfo

         abstract void getMediaUploadAuthorInfo(String fileName, String url, IRongCoreCallback.ResultCallback<MediaUploadAuthorInfo> callback)

        Retrieves the private cloud token for multimedia download.

        Parameters:
        fileName - The name of the multimedia file.
        callback - The callback function.
        Since:

        5.2.3

      • cancelSDKHeartBeat

         abstract void cancelSDKHeartBeat()

        Cancels the wakelock heartbeat. This should be called once globally for the entire application after a successful connection.

        Since:

        5.2.2

      • cancelSendMediaMessage

         abstract void cancelSendMediaMessage(Message message, IRongCoreCallback.OperationCallback callback)

        Cancels the sending of a multimedia file.

        Parameters:
        message - The multimedia file message.
        callback - Callback triggered when the multimedia file sending is canceled.
        Since:

        5.0.0

      • cleanHistoryMessages

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

        Deletes messages before the specified timestamp, with the option to also delete messages on the server.

        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).

        Parameters:
        conversationType - The type of conversation.
        targetId - The ID of the conversation.
        recordTime - The timestamp before which messages will be cleared.
        cleanRemote - Whether to delete messages on the server.
        callback - The callback for message deletion.
        Since:

        5.0.0

      • cleanRemoteHistoryMessages

         abstract void cleanRemoteHistoryMessages(ConversationType conversationType, String targetId, 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 - The conversation type.
        targetId - The conversation ID.
        recordTime - The timestamp for clearing messages, where 0 <= recordTime <= the sentTime of the last message in the current conversation.
        callback - The callback for clearing messages.
        Since:

        5.0.0

      • clearConversations

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

        Clears all conversations and conversation messages of the specified conversation types from the list.

        Parameters:
        callback - Callback indicating whether the operation was successful.
        conversationTypes - List of conversation types to be cleared.
        Since:

        5.0.0

      • clearConversationsByTag

         abstract void clearConversationsByTag(String tagId, boolean deleteMessage, IRongCoreCallback.ResultCallback<Boolean> callback)

        Deletes all conversations under the specified tag. Note: This operation will unbind the relationship between the conversation and the tag. Re-binding is required if you call this again.

        Parameters:
        tagId - The ID of the tag
        deleteMessage - Indicates whether to delete the messages
        callback - Callback for tag deletion
        Since:

        5.1.5

      • clearMessages

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

        Deletes all messages in a specific conversation.

        Note: Chatrooms are not supported!

        Parameters:
        conversationType - The type of conversation.
        targetId - The ID of the conversation.
        callback - Callback indicating whether the operation was successful.
        Since:

        5.0.0

      • clearMessagesUnreadStatus

         abstract void clearMessagesUnreadStatus(ConversationType conversationType, String targetId, IRongCoreCallback.ResultCallback<Boolean> 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 conversation ID.
        callback - Callback indicating whether the operation was successful.
        Since:

        5.0.0

      • clearMessagesUnreadStatus

         abstract void clearMessagesUnreadStatus(ConversationType conversationType, String targetId, 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 conversation ID.
        timestamp - The timestamp of the last message read in this conversation.
        callback - Callback indicating whether the operation was successful.
        Since:

        5.0.0

      • clearMessagesUnreadStatusByTag

         abstract void clearMessagesUnreadStatusByTag(String tagId, IRongCoreCallback.ResultCallback<Boolean> callback)

        Clears the unread message count for all conversations under the specified tag.

        Parameters:
        tagId - The tag ID.
        callback - Callback for clearing the conversations.
        Since:

        5.1.5

      • clearTextMessageDraft

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

        Deletes the draft information in the specified conversation.

        Parameters:
        conversationType - The type of the conversation.
        targetId - The ID of the conversation.
        callback - The callback indicating whether the deletion was successful.
        Since:

        5.0.0

      • deleteMessages

         abstract void deleteMessages(Array<int> messageIds, IRongCoreCallback.ResultCallback<Boolean> callback)

        Deletes messages.

        Parameters:
        messageIds - An array of message IDs to be deleted.
        callback - Callback indicating whether the deletion was successful.
        Since:

        5.0.0

      • deleteMessages

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

        Deletes all messages in a specific conversation.

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

        Parameters:
        conversationType - The type of conversation.
        targetId - The conversation ID.
        callback - Callback indicating whether the deletion was successful.
        Since:

        5.0.0

      • deleteRemoteMessages

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

        Batch deletes specified remote messages in a conversation (and deletes the 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: Chatrooms are not supported!

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

        Parameters:
        conversationType - The conversation type.
        targetId - The conversation ID.
        messages - The array of messages to be deleted.
        callback - Callback indicating whether the deletion was successful.
        Since:

        5.0.0

      • disconnect

         abstract void disconnect()

        Disconnects from the RCserver while still receiving remote notifications.

        If you want to disconnect and stop receiving remote notifications, you can call logout.Note: The SDK automatically reconnects when the app switches between foreground and background or when network exceptions occur, ensuring connection reliability. Therefore, unless your app logic requires logging out, you generally do not need to call this method to manually disconnect.

        Since:

        5.0.0

      • disconnect

         abstract void disconnect(boolean isReceivePush)

        Disconnects from the RCserver and determines whether to continue receiving remote push notifications based on the parameter.

        Parameters:
        isReceivePush - true to continue receiving remote push notifications after disconnection; false to stop receiving remote push notifications after disconnection.
        Since:

        5.0.0

      • logout

         abstract void logout()

        Disconnects from the RCserver and stops receiving remote push notifications.

        To disconnect while still receiving remote push notifications, use disconnect.

        Since:

        5.0.0

      • downloadMedia

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

        Downloads multimedia files.

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

        Parameters:
        conversationType - The type of conversation.
        targetId - The conversation ID.
        mediaType - The type of file.
        imageUrl - The URL of the file.
        callback - The callback for the file download.
        Since:

        5.0.0

      • downloadMediaFile

         abstract void downloadMediaFile(String fileUniqueId, String fileUrl, String fileName, String path, IRongCoreCallback.IDownloadMediaFileCallback callback)

        Download a file.

        Supports resumable downloads. To pause the download, call pauseDownloadMediaFile.

        Parameters:
        fileUniqueId - The unique identifier of the file, corresponding to the first parameter of pauseDownloadMediaFile.
        fileUrl - The download URL of the file.
        fileName - The name of the file.
        path - The directory to save the downloaded file.
        callback - The callback for the file download.
        Since:

        5.0.0

      • getBlockedConversationList

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

        Retrieves the list of conversations with Do Not Disturb enabled.

        Parameters:
        callback - Callback for retrieving conversations with Do Not Disturb.
        conversationTypes - Conversation types, Conversation.
        Since:

        5.0.0

      • getConversation

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

        Retrieves information for a single conversation.

        Parameters:
        conversationType - The type of conversation.
        targetId - The ID of the conversation.
        callback - Callback for retrieving the conversation information.
        Since:

        5.0.0

      • getConversations

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

        Method to retrieve a list of conversations.

        Description: Retrieves a list of conversation objects based on the provided 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 - A list of conversation identifiers specifying the conversations to retrieve.
        callback - A callback for the result of the conversation retrieval, containing the list of conversation objects or error information.
        Since:

        5.8.2

      • getConversationList

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

        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 at the top. If you need to retrieve other types of conversation lists, you can use getConversationList. This method must be called after the database connection is opened, as indicated by the OnDatabaseOpened callback in IRongCoreCallback.ConnectCallback.

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

        5.0.0

      • getConversationList

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

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

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

        5.0.0

      • getTopConversationList

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

        Retrieves the list of pinned conversations based on the conversation type.

        Parameters:
        callback - The callback that returns the list of pinned conversations.
        conversationTypes - The types of pinned conversations to retrieve.
        Since:

        5.0.0

      • 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 - The callback for retrieving the conversation list.
        conversationTypes - The types of conversations to retrieve.
        Since:

        5.3.2

      • getConversationListByPage

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

        Retrieves the conversation list in a paginated manner.

        Parameters:
        callback - Callback to handle the retrieved conversation list.
        timeStamp - Timestamp in milliseconds.
        count - Number of conversations to retrieve.
        conversationTypes - Types of conversations to retrieve.
        Since:

        5.0.0

      • getConversationListByPage

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

        Fetches the conversation list with pagination.

        Parameters:
        callback - The callback for retrieving the conversation list.
        timeStamp - The timestamp in milliseconds.
        count - The number of conversations to retrieve.
        topPriority - Whether to prioritize pinned messages (determines the sorting of the query results.
        conversationTypes - The types of conversations to retrieve.
        Since:

        5.6.9

      • getConversationNotificationStatus

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

        Retrieves the message notification status for a conversation.

        Note: Not supported for chatrooms!

        Parameters:
        conversationType - The type of conversation.
        targetId - The conversation ID.
        callback - Callback to retrieve the message notification status.
        Since:

        5.0.0

      • setConversationNotificationStatus

         abstract void setConversationNotificationStatus(ConversationType conversationType, String targetId, 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.
        notificationStatus - The message notification status to set for the conversation .
        callback - The callback for setting the status.
        Since:

        5.0.0

      • getConversationsFromTagByPage

         abstract void getConversationsFromTagByPage(String tagId, long ts, int count, IRongCoreCallback.ResultCallback<List<Conversation>> callback)

        Paginate and retrieve the conversation list under a specified local tag.

        Parameters:
        tagId - The ID of the tag.
        ts - The timestamp of the last message in the conversation.
        count - The number of conversations to retrieve 20<= count <=100.
        callback - The callback for paginating and retrieving the conversation list under the specified local tag.
        Since:

        5.1.1

      • getConversationTopStatus

         abstract void getConversationTopStatus(String targetId, ConversationType conversationType, 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, guaranteeing the accuracy of the conversation pinning.

        Parameters:
        targetId - The ID of the conversation.
        conversationType - The type of the conversation.
        callback - The callback for the result of the conversation pinning.
        Since:

        5.1.5

      • getUnreadCount

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

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

        Parameters:
        targetId - The target ID of the conversation.
        conversationType - The type of the conversation.
        objectNames - An array of message types.
        callback - The callback for the unread count result.
        Since:

        5.1.5

      • getConversationTopStatusInTag

         abstract void getConversationTopStatusInTag(ConversationIdentifier conversationIdentifier, String tagId, IRongCoreCallback.ResultCallback<Boolean> callback)

        Retrieves the pinned status of a tag in a specified conversation (not supported for ultra groups)

        Parameters:
        conversationIdentifier - ConversationIdentifier
        tagId - tag id
        callback - Callback to retrieve all tags in the specified conversation
        Since:

        5.1.1

      • getCurrentUserId

         abstract String getCurrentUserId()

        Retrieve the information of the currently connected user.

        Returns:

        The information of the currently connected user.

        Since:

        5.1.4

      • getDeltaTime

         abstract long getDeltaTime()

        Gets the time difference between local time and server time.

        After a message is successfully sent, the SDK synchronizes time with the server. The time stored in the message database is the server time. System.currentTimeMillis() - getDeltaTime() can be used to get the current server time.

        Returns:

        The difference between local time and server time.

        Since:

        5.0.0

      • getDownloadInfo

         abstract void getDownloadInfo(String tag, IRongCoreCallback.ResultCallback<DownloadInfo> callback)

        Retrieves media file download information.

        Note: This method is only applicable for resumable downloads.

        Parameters:
        tag - The unique identifier for the file.
        callback - The callback.
        Since:

        5.1.2

      • getGIFLimitSize

         abstract int getGIFLimitSize()

        Gets the maximum allowed size for sending GIF images.

        Returns:

        Returns the maximum allowed size for sending GIF images in KB. Returns -1 if the operation fails.

        Since:

        5.0.0

      • getHistoryMessages

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

        Retrieves the latest message entities of the specified message type, before the specified message, and in the specified quantity from the conversation.

        Parameters:
        conversationType - The conversation type.
        targetId - The conversation ID.
        oldestMessageId - The ID of the last message.
        count - The number of messages to retrieve.
        callback - The callback for retrieving historical messages, sorted in chronological order from newest to oldest.
        Since:

        5.0.0

      • getHistoryMessages

         abstract void getHistoryMessages(ConversationType conversationType, String targetId, List<String> objectNames, long timestamp, 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 get the 10 image and text messages before the message with messageId 22, the objectNames would be a List of strings:

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

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

        Parameters:
        conversationType - The type of conversation.
        targetId - The ID of the conversation.
        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 RongCommonDefine.GetMessageDirection.
        callback - The callback for retrieving historical messages, ordered from newest to oldest.
        Since:

        5.0.0

      • getHistoryMessages

         abstract void getHistoryMessages(ConversationType conversationType, String targetId, String objectName, int baseMessageId, 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 messages before the message with messageId 22, the corresponding parameters would be: getHistoryMessages(conversationType, targetId, RC:ImgMsg, 22, 10, true, resultCallback).Note: The SDK clears the chatroom's historical messages when exiting the chatroom, so retrieving chatroom history after exiting will return an empty list.

        Parameters:
        conversationType - The type of conversation Conversation.
        targetId - The ID of the conversation.
        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 Using the specified baseMessageId as the starting point, messages earlier than baseMessageId are FRONT, and messages later are BEHIND.
        callback - The callback for retrieving historical messages, ordered from newest to oldest.
        Since:

        5.0.0

      • getHistoryMessages

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

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

        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 messageId 9 and 8.Note: The SDK clears the chatroom's historical messages when exiting the chatroom. Therefore, when retrieving historical messages after exiting, the returned list will be empty.

        Parameters:
        conversationType - The type of conversation Conversation.
        targetId - The ID of the conversation.
        objectName - The message type identifier.
        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.0.0

      • getHistoryMessages

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

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

        The returned message list includes the specified message. Messages are ordered from newest to oldest.

        Parameters:
        conversationType - The type of the specified conversation.
        targetId - The ID of the specified conversation.
        sentTime - The send 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 - Callback for the search results.
        Since:

        5.0.0

      • getHistoryMessages

        @Deprecated() abstract List<Message> getHistoryMessages(ConversationType conversationType, String targetId, String objectName, int oldestMessageId, int count)

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

        Parameters:
        conversationType - The type of conversation Conversation.
        targetId - The ID of the conversation.
        objectName - The identifier for the message type.
        oldestMessageId - The ID of the last message, used to fetch the previous `count` messages.
        count - The number of messages to retrieve.
        Returns:

        A list of historical messages, ordered from newest to oldest.

        Since:

        5.0.0

      • getHistoryMessages

        @Deprecated() abstract List<Message> getHistoryMessages(ConversationType conversationType, String targetId, int oldestMessageId, int count)

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

        For example, to get the 10 image and text messages before the message with messageId 22, where objectNames is a List of strings:

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

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

        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.
        Returns:

        A list of historical messages, sorted from newest to oldest.

        Since:

        5.0.0

      • getLatestMessages

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

        Fetches the latest messages from the specified conversation.

        Parameters:
        conversationType - The type of conversation Conversation.
        targetId - The ID of the conversation.
        count - The number of messages to retrieve.
        callback - The callback for fetching the latest messages, ordered from newest to oldest.
        Since:

        5.0.0

      • getMessage

         abstract void getMessage(int messageId, IRongCoreCallback.ResultCallback<Message> callback)

        Retrieves the message body based on the message ID (unique value in the database index).

        Parameters:
        messageId - The message ID.
        callback - The callback.
        Since:

        5.0.0

      • 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.0.0

      • getMessageCount

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

        Retrieves the total number of messages in the specified conversation.

        Parameters:
        conversationType - The type of conversation.
        targetId - The ID of the conversation.
        callback - Callback for the total number of messages.
        Since:

        5.0.0

      • getMessages

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

        Retrieves the history messages of a specified conversation.

        This method first attempts to fetch history 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, a non-zero errorCode is returned, and the locally available messages are still provided via the callback. The historical message cloud storage feature must be enabled.

        Parameters:
        conversationType - The type of conversation Conversation.
        targetId - The ID of the conversation.
        historyMsgOption - HistoryMessageOption
        callback - The callback for retrieving messages.
        Since:

        5.1.2

      • getPushContentShowStatus

         abstract void getPushContentShowStatus(IRongCoreCallback.ResultCallback<Boolean> callback)

        Retrieves the setting for displaying detailed content of remote push notifications.

        Parameters:
        callback - Callback to retrieve whether to display detailed content of remote push notifications, true to display detailed content, false to hide detailed content.
        Since:

        5.0.0

      • getPushReceiveStatus

         abstract void getPushReceiveStatus(IRongCoreCallback.ResultCallback<Boolean> callback)

        Retrieves the setting for whether to receive remote push notifications.

        Prerequisite: When the mobile device is offline and the Web or MAC/PC terminal is online, this setting determines whether the mobile device receives remote push notifications.

        Parameters:
        callback - Callback to retrieve the setting for receiving remote push notifications.
        Since:

        5.0.0

      • getRemoteHistoryMessages

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

        Fetches historical messages from the server before a specified time.

        Unlike getHistoryMessages, this interface pulls messages from the RongCloud server. After pulling messages from the server, the client performs deduplication and returns the deduplicated data. This is typically used to fetch historical messages after switching to a new device. When using this, it is recommended to first pull historical messages from the local database via getHistoryMessages. If no historical messages are found in the local database, then use this interface to fetch server historical messages, 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 fetched already exist in the local database, this interface will not return any data.

        Parameters:
        conversationType - The type of conversation.
        targetId - The target conversation ID.
        dateTime - The starting point for fetching messages.
        count - The number of messages to fetch, 0 < count <= 20.
        callback - The callback for fetching historical messages, ordered from newest to oldest.
        Since:

        5.0.0

      • getRemoteHistoryMessages

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

        Fetches remote history messages for a specified conversation.

        This feature requires the message cloud storage function to be enabled in the RongCloud Developer Console.Note: Chatrooms are not supported!

        Parameters:
        conversationType - Specifies the conversation type.
        targetId - The conversation ID.
        remoteHistoryMsgOption - Configurable parameters RemoteHistoryMsgOption
        callback - Callback for retrieving history messages, ordered from newest to oldest.
        Since:

        5.0.0

      • getSendTimeByMessageId

         abstract long getSendTimeByMessageId(int messageId)

        Retrieves the send time of a message based on its message ID.

        Parameters:
        messageId - The specified message ID.
        Returns:

        The time when the message was successfully sent.

        Since:

        5.0.0

      • getTagsFromConversation

         abstract void getTagsFromConversation(ConversationIdentifier conversationIdentifier, IRongCoreCallback.ResultCallback<List<ConversationTagInfo>> callback)

        Retrieves all tags under the specified conversation

        Parameters:
        conversationIdentifier - ConversationIdentifier
        callback - Callback for retrieving all tags under the specified conversation
        Since:

        5.1.1

      • getTextMessageDraft

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

        Retrieves the draft information from a conversation.

        Parameters:
        conversationType - The type of the conversation.
        targetId - The ID of the conversation.
        callback - The callback to retrieve the draft text content.
        Since:

        5.0.0

      • getTheFirstUnreadMessage

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

        Get the first unread message.

        Parameters:
        conversationType - Specifies the conversation type.
        targetId - Indicates the conversation ID.
        callback - Represents the callback function.
        Since:

        5.0.0

      • getTopForegroundActivity

        @Deprecated() abstract Activity getTopForegroundActivity()

        Retrieves the topmost Activity in the foreground.

        Returns:

        Returns the topmost Activity if the application is in the foreground; returns NULL if the application is in the background.

        Since:

        5.0.0

      • getTotalUnreadCount

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

        Get the total count of unread messages across all conversations.

        Note: This does not include chatrooms; chatroom messages are not counted.

        Parameters:
        callback - Callback for the unread message count.
        Since:

        5.0.0

      • getTotalUnreadCount

         abstract void getTotalUnreadCount(IRongCoreCallback.ResultCallback<Integer> callback, Array<Conversation> conversations)

        Retrieves the total count of unread messages for all specified conversations.

        Note: Chatroom messages are not included in the count.

        Parameters:
        callback - Callback to retrieve the total unread count for specified conversations.
        conversations - Specified conversations.
        Since:

        5.0.0

      • getTypingUserListFromConversation

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

        Get the list of users currently typing in the conversation

        Parameters:
        conversationType - The type of conversation
        targetId - The ID of the conversation
        Returns:

        The list of users currently typing in the conversation

        Since:

        5.0.0

      • getUnreadCount

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

        Retrieves the count of unread messages for the specified conversation.

        Note: Chatroom messages are not included in the count.

        Parameters:
        conversationType - The type of conversation Conversation.
        targetId - The ID of the conversation.
        callback - Callback for the unread message count.
        Since:

        5.0.0

      • getUnreadCount

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

        Retrieves 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 Conversation.
        containBlocked - Indicates whether to include unread messages from muted conversations.
        callback - Callback for the unread message count.
        Since:

        5.0.0

      • getUnreadCount

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

        Retrieves 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 Conversation.
        callback - Callback for the unread message count.
        Since:

        5.0.0

      • getUnreadCount

         abstract void getUnreadCount(IRongCoreCallback.ResultCallback<Integer> callback, 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.
        conversationTypes - Conversation types.
        Since:

        5.0.0

      • getUnreadMentionedMessages

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

        Retrieves unread mention messages in a conversation.

        Parameters:
        conversationType - Specifies the type of conversation.
        targetId - Represents the conversation ID.
        callback - Callback for retrieving unread mention messages.
        Since:

        5.0.0

      • getUnreadMentionedMessages

         abstract void getUnreadMentionedMessages(ConversationType conversationType, String targetId, int count, boolean desc, IRongCoreCallback.ResultCallback<List<Message>> callback)

        Retrieves unread mention messages in a conversation.

        Parameters:
        conversationType - Specifies the type of conversation.
        targetId - Represents the conversation ID.
        count - Maximum number of @ messages.
        desc - true fetches the latest count pieces of data, and false fetches the oldest count pieces of data.
        callback - Callback for getting unread @ messages.
        Since:

        5.2.5

      • getVendorToken

         abstract void getVendorToken(IRongCoreCallback.ResultCallback<String> resultCallback)

        Retrieves the authentication information of the logged-in user.

        Third-party vendors use this interface to obtain a token, which is then used along with the vendor's registration information for authentication with the RCserver.

        Parameters:
        resultCallback - The request callback.
        Since:

        5.0.0

      • getVideoLimitTime

         abstract int getVideoLimitTime()

        Retrieves the maximum allowed duration for sending video files.

        Returns:

        Returns the maximum allowed duration in seconds for sending video files. Returns -1 if the retrieval fails.

        Since:

        5.0.0

      • insertIncomingMessage

         abstract void insertIncomingMessage(ConversationType type, String targetId, String senderUserId, ReceivedStatus receivedStatus, MessageContent content, 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 sent to the server or the recipient. 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.
        senderUserId - The ID of the sender.
        receivedStatus - The received status Message.
        content - The content of the message, such as TextMessage, ImageMessage, etc.
        resultCallback - The callback to obtain the message sending entity.
        Since:

        5.0.0

      • insertIncomingMessage

         abstract void insertIncomingMessage(ConversationType type, String targetId, 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.
        senderUserId - The ID of the sender.
        receivedStatus - The received status Message.
        content - The content of the message, such as TextMessage, ImageMessage, etc.
        sentTime - The sent time of the message getSentTime.
        resultCallback - The callback to obtain the message sending entity.
        Since:

        5.0.0

      • insertOutgoingMessage

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

        Inserts a message into the local conversation.

        This message is only inserted into the local conversation and will not be sent to the server or the recipient. 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 conversation type.
        targetId - The conversation ID.
        sentStatus - The sending status Message.
        content - The message content.
        resultCallback - The callback to obtain the message sending entity.
        Since:

        5.0.0

      • insertOutgoingMessage

         abstract void insertOutgoingMessage(ConversationType type, String targetId, 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 the callback RC_INVALID_PARAMETER_MSG_TAG will be triggered.

        Parameters:
        type - The type of the conversation.
        targetId - The ID of the conversation.
        sentStatus - The sending status Message.
        content - The message content, such as TextMessage, ImageMessage, etc.
        sentTime - The sending time of the message getSentTime.
        resultCallback - The callback to obtain the message sending entity.
        Since:

        5.0.0

      • isFileDownloading

         abstract boolean isFileDownloading(Object uid)

        Checks whether the file is currently being downloaded.

        Note: This method is only applicable for resumable downloads.

        Parameters:
        uid - The file UID, which uniquely identifies the file
        Returns:

        Indicates whether the file is currently being downloaded

        Since:

        5.1.2

      • pauseDownloadMediaFile

         abstract void pauseDownloadMediaFile(String fileUniqueId, IRongCoreCallback.OperationCallback callback)

        Pauses the download of a multimedia file.

        Parameters:
        fileUniqueId - The unique identifier of the file.
        callback - The callback triggered when the download is paused.
        Since:

        5.0.0

      • pauseDownloadMediaMessage

         abstract void pauseDownloadMediaMessage(Message message, IRongCoreCallback.OperationCallback callback)

        Pauses the download of a multimedia message.

        Parameters:
        message - The multimedia file message.
        callback - The callback triggered when the download is paused.
        Since:

        5.0.0

      • recallMessage

         abstract void recallMessage(Message message, String pushContent, IRongCoreCallback.ResultCallback<RecallNotificationMessage> callback)

        Recall message

        Parameters:
        message - The message to be recalled
        pushContent - When sending a push notification, this field will be displayed in the notification bar.
        callback - The RecallNotificationMessage is returned in the onSuccess callback.
        Since:

        5.0.0

      • removeConversation

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

        Removes a conversation from the conversation list.

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

        Parameters:
        conversationType - The type of the conversation Conversation.
        targetId - The ID of the conversation.
        callback - Callback indicating whether the removal was successful, of type Boolean, ResultCallback<Boolean>.
        Since:

        5.0.0

      • removeConversationsFromTag

         abstract void removeConversationsFromTag(String tagId, List<ConversationIdentifier> conversationIdentifierList, IRongCoreCallback.OperationCallback callback)

        Deletes conversations from a specified tag

        Parameters:
        tagId - The ID of the tag
        conversationIdentifierList - The list of conversations
        callback - Callback for deleting conversations from the specified tag
        Since:

        5.1.1

      • removeMessageExpansion

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

        Deletes specific key-value pairs from the message extension information

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

        5.0.0

      • removeTag

         abstract void removeTag(String tagId, IRongCoreCallback.OperationCallback callback)

        Remove tag

        Parameters:
        tagId - Unique identifier of the tag, string type, with a maximum length of 10 characters
        callback - Callback for tag removal
        Since:

        5.1.1

      • removeTagsFromConversation

         abstract void removeTagsFromConversation(ConversationIdentifier conversationIdentifier, List<String> tagIds, IRongCoreCallback.OperationCallback callback)

        Removes specified tags from a conversation

        Parameters:
        conversationIdentifier - ConversationIdentifier
        tagIds - List of tag IDs
        callback - Callback for removing specified tags from a conversation
        Since:

        5.1.1

      • saveTextMessageDraft

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

        Saves draft information for a conversation.

        Parameters:
        conversationType - The type of the conversation.
        targetId - The ID of the conversation.
        content - The text content of the draft.
        callback - Callback indicating whether the save operation was successful.
        Since:

        5.0.0

      • searchConversations

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

        Search conversations based on keywords.

        This method quickly returns a list of matched conversations, including the count of matched messages in each conversation. Use getMatchCount to retrieve this count.Note: To ensure custom messages are searchable, implement the getSearchableWord method in your custom message class.

        Parameters:
        keyword - The keyword to search for.
        conversationTypes - The types of conversations to search.
        objectNames - The types of messages to search, e.g., RC:TxtMsg.
        resultCallback - Callback for search results.
        Since:

        5.0.0

      • searchMessages

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

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

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

        Parameters:
        conversationType - Specifies the conversation type.
        targetId - Specifies the conversation ID.
        keyword - The keyword to search for.
        count - The number of search results to return.
        beginTime - Specifies the timestamp to start searching from.
        resultCallback - Callback for handling search results.
        Since:

        5.0.0

      • searchMessages

         abstract void searchMessages(ConversationType conversationType, String targetId, 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.

        Parameters:
        conversationType - Specifies the conversation type.
        targetId - Specifies the conversation ID.
        keyword - The keyword to search for.
        startTime - The start time of the search range.
        endTime - The end time of the search range.
        offset - The offset for pagination.
        limit - The maximum number of search results to return.
        resultCallback - Callback for the 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 within a specific conversation based on criteria such as keywords, object name lists, and time range. The search results are returned via a callback.

        Parameters:
        conversationIdentifier - The conversation type and conversation ID.
        keyword - The keyword to search for (non-empty).
        objectNameList - An array of message types, supporting multiple types (e.g., text: RC:TxtMsg).
        limit - The maximum number of messages to query [maximum 100; if exceeded, 100 is used].
        startTime - The timestamp to search for messages before this time (pass 0 to start searching from the latest message), in milliseconds.
        resultCallback - The callback interface for search results.
        Since:

        5.8.1

      • searchMessagesByUser

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

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

        Note: To ensure custom messages are searchable, implement the getSearchableWord method in your custom message class.

        Parameters:
        conversationType - The type of the specified conversation.
        targetId - The ID of the specified conversation.
        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 the search results.
        Since:

        5.0.0

      • 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; other users in the conversation will not receive the message. Before sending, construct a Message entity where the content must be a multimedia message. For example: ImageMessage, FileMessage, or any other message that inherits 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 targeted recipient IDs.
        pushContent - This field is displayed in the notification bar when a remote push notification is sent.
        pushData - Additional information for remote push notifications.
        callback - The callback for sending the message .
        Since:

        5.0.0

      • sendDirectionalMessage

         abstract void sendDirectionalMessage(ConversationType type, String targetId, MessageContent content, Array<String> userIds, String pushContent, String pushData, 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 IRongCoreCallback.ISendMessageCallback. This method can only send non-multimedia messages. For multimedia messages such as , FileMessage, or any other messages inherited from , use sendDirectionalMediaMessage. If you are using IMLib, you can use this method to send targeted messages.

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

        Parameters:
        type - The conversation type.
        targetId - The conversation ID, which could be a group ID or ultra group ID.
        content - The message content, such as TextMessage, ImageMessage.
        userIds - The list of users in the discussion group or group conversation who will receive this message.
        pushContent - When sending a remote push notification, this field will be displayed in the notification bar.
        pushData - Additional information for the remote push notification.
        callback - The callback for sending the message, refer to .
        Since:

        5.0.0

      • sendDirectionalMessage

         abstract void sendDirectionalMessage(Message message, Array<String> userIds, String pushContent, String pushData, 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 body are returned through the methods in IRongCoreCallback.ISendMessageCallback. This method can only send non-multimedia messages. For multimedia messages such as , FileMessage, or other messages inheriting from , use sendDirectionalMediaMessage. If you are using IMLib, you can use this method to send targeted messages.

        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.
        callback - The callback for sending the message, refer to .
        Since:

        5.2.3

      • sendDirectionalMessage

         abstract void sendDirectionalMessage(ConversationType type, String targetId, MessageContent content, 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 body are returned through the methods in IRongCoreCallback.ISendMessageCallback. This method can only send non-multimedia messages. For multimedia messages such as , FileMessage, or other messages inherited from , use sendDirectionalMediaMessage. If you are using IMLib, you can use this method to send targeted messages.

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

        Parameters:
        type - The conversation type.
        targetId - The conversation ID, which could be a group ID or ultra group ID.
        content - The message content, such as TextMessage, ImageMessage.
        userIds - The list of users in the discussion group or group conversation who will receive this message.
        pushContent - When sending a remote push notification, this field will be displayed in the notification bar.
        pushData - Additional information for the remote push notification.
        option - Additional options for sending the message.
        callback - The callback for sending the message, refer to .
        Since:

        5.1.2

      • 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 in 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 IRongCoreCallback.ISendMessageCallback. This method can only send non-multimedia messages. For multimedia messages such as , FileMessage, or other messages that inherit from , you must call sendDirectionalMediaMessage. If you are using IMLib, you can use this method to send targeted messages;

        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 - This field will be displayed in the notification bar when a remote push notification is sent.
        pushData - Additional information for remote push notifications.
        option - Additional options for sending the message.
        callback - The callback for sending the message, refer to .
        Since:

        5.2.3

      • sendImageMessage

         abstract void sendImageMessage(ConversationType type, String targetId, 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.

        Parameters:
        type - The conversation type.
        targetId - The conversation ID.
        content - The message content, such as TextMessage, ImageMessage.
        pushContent - When a remote push notification is sent, this field will be displayed in the notification bar.
        pushData - Additional information for the remote push notification.
        callback - The callback for sending the message.
        Since:

        5.0.0

      • sendImageMessage

         abstract void sendImageMessage(Message message, 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.

        Parameters:
        message - The message entity to be sent.
        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.0.0

      • sendImageMessage

         abstract void sendImageMessage(Message message, String pushContent, String pushData, IRongCoreCallback.SendImageMessageWithUploadListenerCallback callback)

        Sends an image message and uploads the image to your own server.

        This method uploads the image to your own server for sending and updates the image status. When using this method to upload an image, it will trigger the callback, which carries the IRongCoreListener.UploadImageStatusListener object. Users only need to call the following methods:update to update the progress,success to update the success status and provide the uploaded image URL,error to update the failure status.

        Parameters:
        message - The message entity to be sent.
        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, which carries the object.
        Since:

        5.0.0

      • sendMediaMessage

         abstract void sendMediaMessage(Message message, String pushContent, String pushData, IRongCoreCallback.ISendMediaMessageCallback callback)

        Sends a multimedia message.

        Construct a Message entity before sending. The content in the message entity must be a multimedia message. For example: ImageMessage, FileMessage, or other messages inherited from MediaMessageContent.

        Parameters:
        message - The message entity to be sent.
        pushContent - This field will be displayed in the notification bar when a remote push notification is sent.
        pushData - Additional information for remote push notifications.
        callback - The callback for sending the message .
        Since:

        5.0.0

      • sendMediaMessage

         abstract void sendMediaMessage(Message message, String pushContent, String pushData, SendMessageOption option, IRongCoreCallback.ISendMediaMessageCallback callback)

        Sends a multimedia message.

        Before sending, construct a Message entity where the content must be a multimedia message. For example: ImageMessage, FileMessage, or other messages that inherit from MediaMessageContent.

        Parameters:
        message - The message entity to be sent.
        pushContent - This field is displayed in the notification bar when a remote push notification is sent.
        pushData - Additional information for remote push notifications.
        option - Additional options for sending the message.
        callback - The callback for sending the message .
        Since:

        5.4.4

      • sendMediaMessage

         abstract void sendMediaMessage(Message message, String pushContent, String pushData, IRongCoreCallback.ISendMediaMessageCallbackWithUploader callback)

        Sends a multimedia message. This method can be used to upload multimedia files to your own server.

        When uploading a multimedia file, the onAttached callback is triggered. This callback carries the IRongCoreCallback.MediaMessageUploader object. Users only need to call the following methods in this object: update to update the progress success to update the success status and provide the file URL after successful upload error to update the failure status cancel to update the cancellation status

        Parameters:
        message - The message entity to be sent.
        pushContent - This field is displayed in the notification bar when a remote push notification is sent.
        pushData - Additional information for remote push notifications.
        callback - The callback for sending the message, which carries the object.
        Since:

        5.0.0

      • sendMediaMessage

         abstract void sendMediaMessage(Message message, String pushContent, String pushData, SendMessageOption option, IRongCoreCallback.ISendMediaMessageCallbackWithUploader callback)

        Sends a multimedia message. This method can be used to upload multimedia files to your own server.

        When uploading a multimedia file, the callback onAttached is triggered. This callback carries the object. Users only need to call the following methods from this object: update to update the progress success to update the success status and provide the file URL after successful upload error to update the failure status cancel to update the cancellation status

        Parameters:
        message - The message entity to be sent.
        pushContent - When sending a remote push notification, 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, which carries the object.
        Since:

        5.4.4

      • sendMessage

         abstract void sendMessage(ConversationType type, String targetId, 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 message sending rate is limited to 5 messages per second.

        Parameters:
        type - The conversation type.
        targetId - The conversation ID.
        content - The message content, such as TextMessage, ImageMessage.
        pushContent - The content displayed in the notification bar when a remote push notification is sent.
        pushData - Additional information for remote push notifications.
        callback - The callback for sending the message.
        Since:

        5.0.0

      • sendMessage

         abstract void sendMessage(Message message, String pushContent, String pushData, IRongCoreCallback.ISendMessageCallback callback)

        Sends a message.

        The message status and body are returned via the methods in .Note: You cannot send more than 5 messages per second.

        Parameters:
        message - The message body to be sent.
        pushContent - When sending a remote push notification, this field is displayed in the notification bar.
        pushData - Additional information for the remote push notification.
        callback - The callback for sending the message.
        Since:

        5.0.0

      • sendMessage

         abstract void sendMessage(Message message, String pushContent, String pushData, SendMessageOption option, IRongCoreCallback.ISendMessageCallback callback)

        Sends a message.

        The status and body of the sent message are returned via the methods in .Note: The message sending rate is limited to 5 messages per second.

        Parameters:
        message - The message body to be sent.
        pushContent - The content displayed in the notification bar when a remote push notification is sent.
        pushData - Additional information for the remote push notification.
        option - Additional options for sending the message.
        callback - The callback for sending the message, refer to .
        Since:

        5.0.0

      • sendPing

         abstract void sendPing()

        OEM implements heartbeat alignment by sending Ping interface. 1. Background WakeLock heartbeat 2. RongPush heartbeat

        Since:

        5.0.0

      • sendReadReceiptMessage

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

        Sends a read receipt for messages in a specific conversation.

        In IMLib, you can register a listener using setReadReceiptListener.

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

        5.0.0

      • sendReadReceiptMessage

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

        Sends a read receipt for messages in a specific conversation.

        For IMLib, you can register a listener using setReadReceiptListener.

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

        5.0.0

      • sendReadReceiptRequest

         abstract void sendReadReceiptRequest(Message message, IRongCoreCallback.OperationCallback callback)

        Initiates a read receipt request for a message (only supported for groups and discussion groups).

        Note: You can only initiate a read receipt request for messages you have sent.

        Parameters:
        message - The message for which the read receipt is requested
        callback - The callback function
        Since:

        5.0.0

      • sendReadReceiptResponse

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

        Send read receipts (only supported for groups and discussion groups)

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

        5.0.0

      • sendTypingStatus

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

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

        Parameters:
        conversationType - Conversation type
        targetId - Conversation ID
        typingContentType - The type name of the message being typed.
        Since:

        5.0.0

      • setConversationStatusListener

         abstract void setConversationStatusListener(IRongCoreListener.ConversationStatusListener listener)

        Sets up multi-device synchronization for conversation status (pin and Do Not Disturb) listeners.

        Parameters:
        listener - The listener for multi-device synchronization of conversation status (pin and Do Not Disturb) ConversationStatusListener
        Since:

        5.0.0

      • setConversationToTopInTag

         abstract void setConversationToTopInTag(String tagId, ConversationIdentifier conversationIdentifier, boolean isTop, IRongCoreCallback.OperationCallback callback)

        Set the top status of a conversation in a tag

        Parameters:
        tagId - tag id
        conversationIdentifier - ConversationIdentifier
        isTop - Whether to pin the conversation
        callback - Callback for unpinning the conversation in the tag
        Since:

        5.1.1

      • setConversationToTop

        @Deprecated() abstract void setConversationToTop(ConversationType conversationType, String targetId, 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 the conversation Conversation.
        targetId - The ID of the conversation.
        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.0.0

      • setConversationToTop

         abstract void setConversationToTop(ConversationType conversationType, String id, 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 Conversation.
        id - The conversation ID.
        isTop - Whether to pin the conversation.
        needCreate - Whether to create the conversation if it does not exist.
        needUpdateTime - Whether to update the conversation's timestamp.
        callback - Callback indicating whether the pinning operation was successful.
        Since:

        Dedicated Cloud 5.6.2

      • setConversationToTop

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

        Sets the sticky status of a conversation.

        If the conversation does not exist, calling this method will automatically create the conversation and set it as sticky.

        Parameters:
        conversationType - The type of conversation Conversation.
        targetId - The ID of the conversation.
        isTop - Whether to set the conversation as sticky.
        callback - Callback to indicate whether the sticky status was successfully set.
        Since:

        5.0.0

      • setMessageExtra

         abstract void setMessageExtra(int messageId, String value, IRongCoreCallback.ResultCallback<Boolean> callback)

        Sets the additional information for a local message.

        This is used to extend the usage scenarios of messages. After setting, messages with additional information can be retrieved via getHistoryMessages.Note: This is only for local use and cannot be synchronized with remote users.

        Parameters:
        messageId - The message ID.
        value - The additional information, with a maximum of 1024 bytes.
        callback - Callback indicating whether the setting was successful.
        Since:

        5.0.0

      • setMessageReadTime

         abstract void setMessageReadTime(long messageId, long timestamp, IRongCoreCallback.OperationCallback callback)

        Sets the read timestamp for a message.

        Parameters:
        messageId - The ID of the message
        timestamp - The timestamp of the message
        callback - Callback triggered when the message read status is set
        Since:

        5.0.0

      • setMessageReceivedStatus

         abstract void setMessageReceivedStatus(int messageId, ReceivedStatus receivedStatus, IRongCoreCallback.ResultCallback<Boolean> callback)

        Sets the message received status.

        Parameters:
        messageId - The message ID.
        receivedStatus - The received message status.
        callback - Callback indicating whether the setting was successful.
        Since:

        5.0.0

      • setMessageSentStatus

         abstract void setMessageSentStatus(Message message, IRongCoreCallback.ResultCallback<Boolean> callback)

        Sets the message sending status. Note: Users are not allowed to set it to SENDING

        Parameters:
        message - The message object.
        callback - Callback indicating whether the setting was successful.
        Since:

        5.0.0

      • setNotificationQuietHours

         abstract void setNotificationQuietHours(String startTime, int spanMinutes, IRongCoreCallback.OperationCallback callback)

        Sets the Do Not Disturb time for message notifications.

        Parameters:
        startTime - The start time in the format HH:MM:SS.
        spanMinutes - The duration in minutes from the start time to the end time of the Do Not Disturb period.
        callback - Callback for the Do Not Disturb time setting.
        Since:

        5.0.0

      • setOfflineMessageDuration

         abstract void setOfflineMessageDuration(int duration, IRongCoreCallback.ResultCallback<Long> callback)

        Sets the storage duration for offline messages on the server (in days).

        Note: This feature requires customers to submit a ticket. The method will only take effect after the feature is enabled on the server.

        Parameters:
        duration - The compensation time for offline messages, range [1~7 days].
        callback - The callback
        Since:

        5.0.0

      • setPushContentShowStatus

         abstract void setPushContentShowStatus(boolean showStatus, IRongCoreCallback.OperationCallback callback)

        Sets whether to display the details of remote push notifications.

        Note: This feature requires enabling user settings from the server side.

        Parameters:
        showStatus - Indicates whether to display the content of remote push notifications.
        callback - The callback function.
        Since:

        5.0.0

      • setPushLanguage

         abstract void setPushLanguage(IRongCoreEnum.PushLanguage language, IRongCoreCallback.OperationCallback callback)

        Sets the language for remote push notifications. Currently supports Chinese and English.

        Prerequisite: The mobile device is offline, while the Web or MAC/PC terminal is online. Determines whether the mobile device receives remote push notifications.Note: This feature requires enabling user settings from the server side.

        Parameters:
        language - The language type for remote push notifications, .
        callback - The callback to execute the operation
        Since:

        5.0.0

      • setPushLanguageCode

         abstract void setPushLanguageCode(String language, IRongCoreCallback.OperationCallback callback)

        Sets the natural language for push notification content.

        Parameters:
        language - The language environment set via the SDK.
        callback - The callback to execute the operation.
        Since:

        5.0.0

      • setPushNotificationListener

         abstract void setPushNotificationListener(IRongCoreListener.PushNotificationListener listener)

        Sets up a listener for changes in push notification configuration. This method is triggered when server-side configurations, such as push language or whether to display notification details, are changed. The callback is initialized upon the first successful connection.

        Parameters:
        listener - The listener for whether to display notification details
        Since:

        5.1.1

      • setPushReceiveStatus

         abstract void setPushReceiveStatus(boolean receiveStatus, IRongCoreCallback.OperationCallback callback)

        Sets whether to receive remote notifications.

        Note: This feature requires enabling user settings from the server side.

        Parameters:
        receiveStatus - Indicates whether to receive remote notifications.
        callback - The callback
        Since:

        5.0.0

      • setReconnectKickEnable

         abstract void setReconnectKickEnable(boolean enable)

        Sets whether to kick out the reconnecting device during reconnection.

        If the user has not enabled multi-device login, when the same account logs in on a new device, the account will be kicked out from the previously logged-in device. Due to the SDK's reconnection mechanism, the following scenario may occur: The user logs in on device A, but device A has an unstable network connection and fails to connect. The SDK initiates a reconnection mechanism. Meanwhile, the user logs in on device B, and device B successfully connects. When device A's network stabilizes, the user successfully connects on device A, and device B is kicked out. This interface is designed to address such scenarios. When enable is set to true, if the SDK detects that another device has successfully connected during reconnection, it will not forcibly kick out the already connected device but instead kick out the reconnecting device.Note: 1. This feature requires submitting a ticket to enable it on the server side before the client-side method takes effect. 2. This method must be called before init.

        Parameters:
        enable - Whether to kick out the reconnecting device
        Since:

        5.0.0

      • setRLogFileMaxSize

         abstract void setRLogFileMaxSize(long pSize)

        Sets the size of the business log file, with a default of 1M.

        The setting takes effect immediately. When the log file exceeds the specified size, it is compressed into a zip file and stored locally.

        Parameters:
        pSize - The size of the log file, in bytes.
        Since:

        5.0.0

      • setRLogLevel

         abstract void setRLogLevel(int pLevel)

        Sets the console log level. Must be called after initialization.

        Parameters:
        pLevel - The log level.
        Since:

        5.0.0

      • setTagListener

         abstract void setTagListener(IRongCoreListener.TagListener listener)

        Sets the callback for conversation tag changes.

        This listener is triggered when a user adds, removes, or updates tags on another device, enabling synchronization across multiple devices. Upon receiving this callback, you can call getTags to retrieve the latest tag information.

        Call this method after initialization but before connecting.

        Parameters:
        listener - The conversation tag listener.
        Since:

        5.1.1

      • setUploadCallback

        @Deprecated() abstract void setUploadCallback(UploadCallback pCallback)

        Sets the callback for uploading RLog logs to the server.

        Parameters:
        pCallback - The log upload callback.
        Since:

        5.0.0

      • stopDestructMessage

         abstract void stopDestructMessage(Message message)

        Cancel the burn-after-reading message. Only supported in one-to-one chat.

        Parameters:
        message - The message to cancel burn-after-reading.
        Since:

        5.0.0

      • switchAppKey

         abstract void switchAppKey(String appKey)

        Switch appKey.

        When an application corresponds to multiple environments, i.e., multiple appKeys, call this method to achieve hot-switching of the RCSDK. Note: After calling this method, you must call init and connect again, passing the token corresponding to the new appKey, to reinitialize and reconnect.

        Parameters:
        appKey - The alternate appKey for the application.
        Since:

        5.0.0

      • syncConversationReadStatus

         abstract void syncConversationReadStatus(ConversationType type, String targetId, 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.
        timestamp - The sent timestamp of the last read message in the conversation getSentTime.
        callback - The callback function.
        Since:

        5.0.0

      • updateConversationInfo

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

        Updates conversation information.

        Parameters:
        conversationType - The type of the conversation Conversation.
        targetId - The ID of the conversation
        title - The title of the conversation
        portrait - The avatar of the conversation
        callback - The callback
        Since:

        5.0.0

      • updateMessageExpansion

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

        Update message extension information

        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 extension information
        Since:

        5.0.0

      • addToBlacklist

         abstract void addToBlacklist(String userId, IRongCoreCallback.OperationCallback callback)

        Adds a user to the blocklist.

        After adding a user to the blocklist, when they send a message, they will receive a notification saying, Your message has been sent, but it was rejected by the recipient. However, you can still send messages to them.

        Parameters:
        userId - The user ID.
        callback - Callback for adding to the blocklist.
        Since:

        5.0.0

      • doMethod

         abstract Map doMethod(String clazzName, String methodKey, Map param)
        Since:

        5.0.0

      • getUnreadCountByTag

         abstract void getUnreadCountByTag(String tagId, boolean containBlocked, IRongCoreCallback.ResultCallback<Integer> callback)

        Get unread message count by tag

        Parameters:
        tagId - tag id
        containBlocked - Indicates whether to include messages from muted conversations
        callback - Callback for retrieving unread message count by tag
        Since:

        5.1.1

      • getRCConfiguration

         abstract RCConfiguration getRCConfiguration()

        IM Configuration

        Since:

        5.2.0

      • updateRcConfiguration

         abstract void updateRcConfiguration(RCConfiguration configuration)

        Update RCConfiguration Must be set after the init method is executed to take effect

        Since:

        5.2.0

      • isTextTranslationSupported

         abstract boolean isTextTranslationSupported()

        Indicates whether the translation feature is supported.

        Since:

        5.2.1

      • getTranslationInfo

         abstract TranslationInfo getTranslationInfo(int messageId, String language)

        Retrieves cached translation information

        Parameters:
        messageId - The ID of the message
        language - The language identifier
        Returns:

        The cached translation information

        Since:

        5.2.1

      • saveMessageTranslation

         abstract void saveMessageTranslation(int messageId, String content, String targetLanguage)

        Save translation

        Since:

        5.2.1

      • getAIAddress

         abstract String getAIAddress()

        Get the translation URL

        Since:

        5.2.1

      • setAppVer

         abstract void setAppVer(String appVer)

        Sets the application version information for users integrating the RCSDK.

        Note: Must be called after init.

        Parameters:
        appVer - The user's version information.
        Since:

        5.0.0

      • setPingTimeOut

         abstract void setPingTimeOut(int time)
        Parameters:
        time - Timeout duration in milliseconds
        Since:

        5.2.5

      • enableSingleProcess

         abstract void enableSingleProcess(boolean enable)

        Sets whether to enable single process mode.

        Note: Must be called before init.

        Parameters:
        enable - Whether to enable single process mode.
        Since:

        5.3.0

      • setProxy

         abstract boolean setProxy(RCIMProxy proxy)

        Set Proxy

        Since:

        5.3.0

      • getCurrentProxy

         abstract RCIMProxy getCurrentProxy()

        Retrieves the current proxy.

        Since:

        5.3.0

      • setCheckDuplicateMessage

         abstract void setCheckDuplicateMessage(boolean enableCheck)

        Set the RCmessage deduplication switch

        When the sender sends a message under poor network conditions, the message reaches the server but the sender does not receive the server's ack, causing the sender to assume the message failed to send. In this case, both the server and the receiver will receive the first message. The sender then resends the message, which reaches the server again, resulting in two messages on the server (with the same content but different messageUids). The receiver will receive two messages with the same content but different messageUids. The SDK will deduplicate the second message with the same content to ensure that only one message is received by both the sender and the receiver for the resent message.

        When the message volume is low, message deduplication has little impact. However, when there is a large number of local messages, deduplication can cause performance issues. If the app has a large number of local messages and experiences message reception lag, it is recommended to turn off deduplication.

        Parameters:
        enableCheck - Whether to use the RCmessage deduplication mechanism.
        Since:

        5.3.4

      • sendReadReceiptMessageV4

         abstract void sendReadReceiptMessageV4(ConversationType conversationType, String targetId, 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
        startMessageUID - Message UID from which the read receipt starts in group chat (empty for one-to-one chat)
        endMessageUID - Message UID of the last read message
        callback - Callback function
        Since:

        5.6.7

      • getMessageReadReceiptV4

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

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

        Parameters:
        targetId - The conversation ID
        messageUID - The message in the conversation that requires a read receipt
        callback - The callback function
        Since:

        5.6.7

      • subscribeEvent

         abstract void subscribeEvent(SubscribeEventRequest request, IRongCoreCallback.SubscribeEventCallback<List<String>> callback)

        Subscribes to user status events.

        This method is used to subscribe to the status of a group of users. When the status of these users changes, the caller will be notified through the callback interface.

        Parameters:
        request - The subscription request object containing the user information for which status needs to be subscribed.
        callback - The result callback used to receive the result of the subscription operation or status update notifications.
        Since:

        5.8.0

      • unSubscribeEvent

         abstract void unSubscribeEvent(SubscribeEventRequest request, IRongCoreCallback.SubscribeEventCallback<List<String>> callback)

        Unsubscribes from user status events.

        This method is used to unsubscribe from previously subscribed user status events.

        Parameters:
        request - The unsubscribe request object containing user information for unsubscribing from status events.
        callback - The result callback for receiving the outcome of the unsubscribe operation.
        Since:

        5.8.0

      • addSubscribeEventListener

         abstract void addSubscribeEventListener(OnSubscribeEventListener listener)

        Adds a subscription event listener.

        Used to add a listener to receive all subscribed user status change events.

        Parameters:
        listener - The subscription event listener.
        Since:

        5.8.0

      • querySubscribeEvent

         abstract void querySubscribeEvent(SubscribeEventRequest request, IRongCoreCallback.ResultCallback<List<SubscribeInfoEvent>> callback)

        Queries the current status of subscribed events.

        This method retrieves the status information of all currently subscribed events.

        Parameters:
        request - The query request object, which can specify the particular subscribed events to query.
        callback - The callback through which the list of subscribed events is returned upon completion of the query operation.
        Since:

        5.8.0

      • updateMyUserProfile

         abstract void updateMyUserProfile(UserProfile profile, IRongCoreCallback.UpdateUserProfileCallback callback)

        Update user profile

        Note: It is recommended to fetch the user profile first and then update the profile based on the latest user profile.

        Parameters:
        profile - User profile information
        callback - The operation result is returned through this callback once the operation is completed.
        Since:

        5.10.0

      • getUserProfiles

         abstract void getUserProfiles(List<String> userIdList, IRongCoreCallback.ResultCallback<List<UserProfile>> callback)

        Batch retrieve user profiles

        Parameters:
        userIdList - List of user IDs, with a maximum of 20 IDs per request
        callback - Returns the list of user profiles through this callback upon completion
        Since:

        5.10.0

      • getMyUserProfile

         abstract void getMyUserProfile(IRongCoreCallback.ResultCallback<UserProfile> callback)

        Get the current user profile

        Parameters:
        callback - The user profile is returned through this callback after the operation is completed.
        Since:

        5.10.0

      • updateMyUserProfileVisibility

         abstract void updateMyUserProfileVisibility(UserProfileVisibility visibility, IRongCoreCallback.ResultCallback<Boolean> callback)

        User Permission Settings

        Parameters:
        visibility - User information permission
        callback - The operation result is returned through this callback after the operation is completed.
        Since:

        5.10.0

      • searchUserProfileByUniqueId

         abstract void searchUserProfileByUniqueId(String uniqueId, IRongCoreCallback.ResultCallback<UserProfile> callback)

        Search for user information by exact user application ID

        Parameters:
        uniqueId - The user application ID
        callback - The callback to return the result after the operation is completed
        Since:

        5.10.0

      • createGroup

         abstract void createGroup(GroupInfo groupInfo, List<String> inviteeUserIds, IRongCoreCallback.CreateGroupCallback callback)

        Create Group

        Note: The following attributes can be set in the group information (GroupInfo): 1. Group ID (id), with a maximum length of 64 characters. Supports a combination of uppercase and lowercase letters and numbers. 2. Group name (name), with a maximum length of 64 characters. 3. Group avatar (portraitUri), with a maximum length of 128 characters. 4. Group introduction (introduction), with a maximum length of 512 characters. 5. Group notice (notice), with a maximum length of 1024 characters. 6. Group extended information (extProfile), with a default maximum of 10 items. This must be configured via the developer console or API; otherwise, the setting will fail. 7. Active join group permission mode (joinPermission). 8. Remove member from group permission mode (removeMemberPermission). 9. Invite others to join group permission mode (invitePermission). 10. Invited user join group permission mode (inviteHandlePermission). 11. Group information update permission mode (groupInfoEditPermission). 12. Group member information update permission mode (memberInfoEditPermission). Note: Group ID (id) and group name (name) are mandatory fields; otherwise, the API call will fail. For details, refer to GroupInfo.

        Parameters:
        groupInfo - Group information.
        inviteeUserIds - An array of user IDs to be invited to the group, with a maximum of 30 users allowed at once.
        callback - The result of the operation is returned via this callback.
      • updateGroupInfo

         abstract void updateGroupInfo(GroupInfo groupInfo, IRongCoreCallback.OperationCallbackEx<String> callback)

        Update group information

        The group information update mode, defined by , determines whether group information and permission details can be modified.

        Note: The following attributes of the group information (GroupInfo) can be set: 1. Group ID (id), with a maximum length of 64 characters. Supports a combination of uppercase and lowercase letters and numbers. 2. Group name (name), with a maximum length of 64 characters. 3. Group avatar (portraitUri), with a maximum length of 128 characters. 4. Group introduction (introduction), with a maximum length of 512 characters. 5. Group notice (notice), with a maximum length of 1024 characters. 6. Group extended information (extProfile), which can be set up to 10 items by default. This must be configured via the developer backend or API; otherwise, the setting will fail. 7. Permission mode for actively joining the group (joinPermission). 8. Permission mode for removing members from the group (removeMemberPermission). 9. Permission mode for inviting others to join the group (invitePermission). 10. Permission mode for handling invitations to join the group (inviteHandlePermission). 11. Permission mode for updating group information (groupInfoEditPermission). 12. Permission mode for updating member information (memberInfoEditPermission). Note: The group ID (id) and group name (name) are mandatory fields; otherwise, the API call will fail. For more details, refer to GroupInfo.

        Parameters:
        groupInfo - The group information to be updated.
        callback - The callback to return the result after the operation is completed.
      • getGroupsInfo

         abstract void getGroupsInfo(List<String> groupIds, IRongCoreCallback.ResultCallback<List<GroupInfo>> callback)

        Batch Retrieve Group Information

        Note: Only returns information for existing groups.

        Parameters:
        groupIds - Array of group IDs.
        callback - The result is returned through this callback after the operation is completed.
      • kickGroupMembers

         abstract void kickGroupMembers(String groupId, List<String> userIds, QuitGroupConfig config, IRongCoreCallback.OperationCallback callback)

        Remove from Group

        Note: After a user is removed, the group conversation information is retained, but the user will no longer receive messages from this group. Local historical messages are not deleted.

        Parameters:
        groupId - The group ID.
        userIds - An array of group member IDs.
        config - Configuration for removing users from the group.
        callback - The result of the operation is returned through this callback.
      • quitGroup

         abstract void quitGroup(String groupId, QuitGroupConfig config, IRongCoreCallback.OperationCallback callback)

        Exit a group

        Note: After exiting, the group conversation information is retained, but the user will no longer receive messages from this group. Local historical messages are not deleted.

        Parameters:
        groupId - The group ID.
        config - Configuration for exiting the group.
        callback - The result is returned through this callback after the operation is completed.
      • dismissGroup

         abstract void dismissGroup(String groupId, IRongCoreCallback.OperationCallback callback)

        Dismiss a group

        Note: Only the group owner can dismiss a group they created. After dismissal, the group conversation information is retained, and local history messages are not deleted.

        Parameters:
        groupId - The ID of the group.
        callback - The result is returned through this callback after the operation is completed.
      • transferGroupOwner

         abstract void transferGroupOwner(String groupId, String newOwnerId, boolean quitGroup, QuitGroupConfig config, IRongCoreCallback.OperationCallback callback)

        Transfer group ownership

        Parameters:
        groupId - The group ID.
        newOwnerId - The user ID of the new group owner after the transfer.
        quitGroup - Whether to quit the group after the transfer.
        config - Configuration for kicking out of the group.
        callback - The result of the operation is returned through this callback.
      • addGroupManagers

         abstract void addGroupManagers(String groupId, List<String> userIds, IRongCoreCallback.OperationCallback callback)

        Add Group Administrators

        Note: Only the group owner can add group administrators. A group can have up to 10 administrators. The group owner cannot be set as an administrator.

        Parameters:
        groupId - The group ID.
        userIds - The list of administrator user IDs.
        callback - The result is returned through this callback after the operation is completed.
      • removeGroupManagers

         abstract void removeGroupManagers(String groupId, List<String> userIds, IRongCoreCallback.OperationCallback callback)

        Remove group administrators

        Parameters:
        groupId - The group ID.
        userIds - List of administrator user IDs.
        callback - The result is returned through this callback after the operation is completed.
      • getGroupMembersByRole

         abstract void getGroupMembersByRole(String groupId, GroupMemberRole role, PagingQueryOption option, IRongCoreCallback.PageResultCallback<GroupMemberInfo> callback)

        Retrieve the member list of a specified group with pagination.

        Note: The results are prioritized in the following order: group owner, group administrators, and then regular group members.

        Parameters:
        groupId - The group ID.
        role - The role of the group members to query.
        option - Pagination request parameters.
        callback - The callback through which the result is returned upon completion.
      • getGroupMembers

         abstract void getGroupMembers(String groupId, List<String> userIds, IRongCoreCallback.ResultCallback<List<GroupMemberInfo>> callback)

        Retrieves information about specified group members

        Parameters:
        groupId - The ID of the group.
        userIds - A list of group member IDs.
        callback - The result is returned through this callback after the operation is completed.
      • setGroupMemberInfo

         abstract void setGroupMemberInfo(String groupId, String userId, String nickname, String extra, IRongCoreCallback.OperationCallback callback)

        Set group member profile

        The group member information update mode, memberInfoEditPermission , determines whether group member profiles can be modified.

        Parameters:
        groupId - The group ID.
        userId - The user ID of the group member.
        nickname - The nickname of the group member.
        extra - Additional information for the group member.
        callback - The callback through which the result is returned after the operation is completed.
      • searchGroupMembers

         abstract void searchGroupMembers(String groupId, String name, PagingQueryOption option, IRongCoreCallback.PageResultCallback<GroupMemberInfo> callback)

        Query group member information based on group member nickname.

        Parameters:
        groupId - The ID of the group.
        name - The search keyword for the group member nickname.
        option - Pagination request parameters.
        callback - The result is returned through this callback after the operation is completed.
      • joinGroup

         abstract void joinGroup(String groupId, IRongCoreCallback.ResultCallback<IRongCoreEnum.CoreErrorCode> callback)

        Join a group

        The group join permission io.rong.imlib.model.GroupJoinPermission determines whether a user can join the group.

        Parameters:
        groupId - The ID of the group.
        callback - The callback that returns the result after the operation is completed.
      • inviteUsersToGroup

         abstract void inviteUsersToGroup(String groupId, List<String> userIds, IRongCoreCallback.ResultCallback<IRongCoreEnum.CoreErrorCode> callback)

        Invite Users to Join a Group

        Who can invite others to join the group is determined by .

        How the invitation to join the group is handled is determined by .

        Parameters:
        groupId - The ID of the group.
        userIds - The list of user IDs to be invited.
        callback - The callback to return the result after the operation is completed.
      • acceptGroupInvite

         abstract void acceptGroupInvite(String groupId, String inviterId, IRongCoreCallback.OperationCallback callback)

        User agrees to join a group

        Parameters:
        groupId - The ID of the group.
        inviterId - The user ID of the inviter.
        callback - The result is returned through this callback after the operation is completed.
      • refuseGroupInvite

         abstract void refuseGroupInvite(String groupId, String inviterId, String reason, IRongCoreCallback.OperationCallback callback)

        User declined to join the group

        Parameters:
        groupId - The ID of the group.
        inviterId - The user ID of the inviter.
        reason - The reason for declining: Optional field, users can choose to input a reason when declining, with a maximum of 128 characters.
        callback - The result of the operation is returned through this callback.
      • acceptGroupApplication

         abstract void acceptGroupApplication(String groupId, String inviterId, String applicantId, IRongCoreCallback.ResultCallback<IRongCoreEnum.CoreErrorCode> callback)

        The group owner or administrator approves the user to join the group.

        Parameters:
        groupId - The ID of the group.
        inviterId - The ID of the inviter.
        applicantId - The ID of the user requesting to join the group.
        callback - The callback through which the operation result is returned.
      • refuseGroupApplication

         abstract void refuseGroupApplication(String groupId, String inviterId, String applicantId, String reason, IRongCoreCallback.OperationCallback callback)

        The group owner or administrator rejects a user's request to join the group.

        Parameters:
        groupId - The ID of the group.
        inviterId - The ID of the inviter.
        applicantId - The ID of the user applying to join the group.
        reason - The reason for rejection.
        callback - The callback to return the result after the operation is completed.
      • getGroupApplications

         abstract void getGroupApplications(PagingQueryOption option, Array<GroupApplicationDirection> directions, Array<GroupApplicationStatus> status, IRongCoreCallback.PageResultCallback<GroupApplicationInfo> callback)

        Fetch paginated group request list

        Parameters:
        option - Pagination request parameters.
        directions - Array of request directions.
        status - Array of group request statuses.
        callback - Callback that returns the result after the operation is completed.
      • getJoinedGroupsByRole

         abstract void getJoinedGroupsByRole(GroupMemberRole role, PagingQueryOption option, IRongCoreCallback.PageResultCallback<GroupInfo> callback)

        Paginated query for the list of groups a user belongs to

        Parameters:
        role - The user's role in the group.
        option - Pagination request parameters.
        callback - The result is returned through this callback upon completion.
      • searchJoinedGroups

         abstract void searchJoinedGroups(String groupName, PagingQueryOption option, IRongCoreCallback.PageResultCallback<GroupInfo> callback)

        Search for groups I have joined by group name

        Parameters:
        groupName - The search keyword for group name.
        option - Pagination request parameters.
        callback - The result is returned through this callback after the operation is completed.
      • getJoinedGroups

         abstract void getJoinedGroups(List<String> groupIds, IRongCoreCallback.ResultCallback<List<GroupInfo>> callback)

        Batch retrieve the groups I have joined

        Parameters:
        groupIds - List of group IDs.
        callback - The result is returned through this callback after the operation is completed.
      • setGroupRemark

         abstract void setGroupRemark(String groupId, String remark, IRongCoreCallback.OperationCallback callback)

        Set Group Alias

        Parameters:
        groupId - The group ID.
        remark - The alias.
        callback - The result is returned through this callback after the operation is completed.
      • addGroupFollows

         abstract void addGroupFollows(String groupId, List<String> userIds, IRongCoreCallback.OperationCallback callback)

        Set special attention users for a group

        Parameters:
        groupId - The group ID.
        userIds - An array of user IDs to be specially followed.
        callback - The result is returned through this callback after the operation is completed.
      • removeGroupFollows

         abstract void removeGroupFollows(String groupId, List<String> userIds, IRongCoreCallback.OperationCallback callback)

        Remove users from the group's special attention list

        Parameters:
        groupId - The group ID.
        userIds - An array of user IDs to be removed from the special attention list.
        callback - The result of the operation is returned through this callback upon completion.
      • getGroupFollows

         abstract void getGroupFollows(String groupId, IRongCoreCallback.ResultCallback<List<FollowInfo>> callback)

        Query the list of specially followed users in a group

        Parameters:
        groupId - The ID of the group.
        callback - The result is returned through this callback after the operation is completed.
      • addFriend

         abstract void addFriend(String userId, DirectionType directionType, String extra, IRongCoreCallback.ResultCallback<IRongCoreEnum.CoreErrorCode> callback)

        Add Friend

        Parameters:
        userId - The user ID of the user to be added as a friend.
        directionType - The direction type of the friend relationship: bidirectional friend.
        extra - Additional information.
        callback - The callback that returns the result after the operation is completed.
      • deleteFriends

         abstract void deleteFriends(List<String> userIds, DirectionType directionType, IRongCoreCallback.OperationCallback callback)

        Remove Friends

        Note: Mutual friend removal: Removes the friend from both parties' friend lists.

        Parameters:
        userIds - List of user IDs to remove from the friend relationship, with a maximum of 100 users per operation.
        directionType - Type of friend removal direction: mutual friends.
        callback - The result is returned through this callback after the operation is completed.
      • acceptFriendApplication

         abstract void acceptFriendApplication(String userId, IRongCoreCallback.OperationCallback callback)

        Agree to add as a friend

        Parameters:
        userId - The user ID of the user who agrees to become a friend
        callback - The result is returned through this callback after the operation is completed.
      • refuseFriendApplication

         abstract void refuseFriendApplication(String userId, IRongCoreCallback.OperationCallback callback)

        Reject friend request

        Parameters:
        userId - The user ID of the user whose friend request is being rejected
        callback - The result of the operation is returned through this callback.
      • setFriendInfo

         abstract void setFriendInfo(String userId, String remark, Map<String, String> extProfile, IRongCoreCallback.OperationCallback callback)

        Set friend information

        Parameters:
        userId - The user ID of the friend
        remark - The remark name for the friend.
        extProfile - Extended information.
        callback - The result is returned via this callback after the operation is completed.
      • checkFriends

         abstract void checkFriends(List<String> userIds, DirectionType directionType, IRongCoreCallback.ResultCallback<List<FriendRelationInfo>> callback)

        Check friend relationship

        For details on friend relationship types, refer to

        Parameters:
        userIds - List of user IDs to check for friend relationships.
        directionType - The type of friend direction to check: bidirectional friend.
        callback - The result is returned through this callback after the operation is completed.
      • getFriends

         abstract void getFriends(QueryFriendsDirectionType type, IRongCoreCallback.ResultCallback<List<FriendInfo>> callback)

        Get the complete friend list

        Parameters:
        type - The direction type of friends: bidirectional friends.
        callback - The result is returned through this callback after the operation is completed.
      • getFriendApplications

         abstract void getFriendApplications(PagingQueryOption option, Array<FriendApplicationType> types, Array<FriendApplicationStatus> status, IRongCoreCallback.PageResultCallback<FriendApplicationInfo> callback)

        Paginate through the list of friend requests

        Parameters:
        option - Pagination request parameters.
        types - Request types.
        status - Request status.
        callback - The result is returned through this callback upon completion.
      • getFriendsInfo

         abstract void getFriendsInfo(List<String> userIds, IRongCoreCallback.ResultCallback<List<FriendInfo>> callback)

        Search for friend information based on user IDs

        Parameters:
        userIds - List of user IDs, with a maximum of 100 friend information retrievable at once
        callback - The result is returned through this callback after the operation is completed.
      • searchFriendsInfo

         abstract void searchFriendsInfo(String name, IRongCoreCallback.ResultCallback<List<FriendInfo>> callback)

        Search for friend information based on nickname

        Parameters:
        name - The nickname keyword of the user.
        callback - The result is returned through this callback after the operation is completed.
      • setFriendAddPermission

         abstract void setFriendAddPermission(FriendAddPermission permission, IRongCoreCallback.OperationCallback callback)

        Sets the friend request permission for the current user.

        Parameters:
        permission - The friend request permission.
        callback - The result is returned through this callback after the operation is completed.
      • getFriendAddPermission

         abstract void getFriendAddPermission(IRongCoreCallback.ResultCallback<FriendAddPermission> callback)

        Get the current user's friend request permission

        Parameters:
        callback - The result is returned through this callback after the operation is completed.