getMessages

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

Retrieves the historical messages of a specified conversation.

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

Since

5.1.2

Deprecated

This interface is deprecated. Use getMessages instead.

Parameters

conversationType

The type of the conversation.

targetId

The ID of the conversation. Depending on the conversationType, this could be a user ID, discussion group ID, group ID, or chatroom ID.

channelId

The business identifier of the conversation to which the message belongs.

historyMessageOption

HistoryMessageOption

callback

The callback.


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

Fetches historical messages for a specified conversation.

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

Since

5.1.2

Parameters

conversationType

The type of conversation.

targetId

The ID of the conversation. Depending on the conversationType, this could be a user ID, discussion group ID, group ID, or chatroom ID.

channelId

The business identifier of the conversation to which the message belongs.

historyMessageOption

HistoryMessageOption

getMessageCallback

The callback.