get History Messages
Retrieves a list of messages in the conversation that meet the specified criteria.
The returned messages do not include the message corresponding to oldestMessageId. If the number of messages in the conversation is less than the value of the count parameter, all messages in the conversation will be returned. For example, if oldestMessageId is 10 and count is 2, the method will return a list of Message objects with messageId 9 and 8.
Parameters
The type of conversation Conversation.ConversationType
The ID of the conversation. Depending on the conversationType, this could be a user ID, discussion group ID, or group ID.
The message type identifier.
The ID of the last message. This method retrieves the count messages before this message. For the first call, this should be set to -1 if there are no messages.
The number of messages to retrieve.
The callback for retrieving historical messages, ordered chronologically from newest to oldest.
Retrieves a list of messages in the conversation that meet the specified criteria.
For example, to retrieve the 10 image messages before the message with ID 22, the corresponding parameters would be: getHistoryMessages(conversationType, targetId, RC:ImgMsg, 22, 10, true, resultCallback).
Parameters
The type of conversation Conversation.ConversationType
The ID of the conversation. Depending on the conversationType, this could be a user ID, discussion group ID, or group ID.
The message type identifier. Examples include RC:TxtMsg, RC:ImgMsg, RC:VcMsg, etc. value
The starting message ID.
The number of messages to retrieve.
The direction of the messages relative to the baseMessageId Using the specified baseMessageId as the starting point, messages earlier than baseMessageId are FRONT, and those later are BEHIND.
The callback for retrieving historical messages, ordered from newest to oldest.
Retrieves a list of messages in the conversation that meet the specified criteria.
For example: To get the 10 previous image and text messages before the message with messageId 22, the objectNames should 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
The type of conversation Conversation.ConversationType
The ID of the conversation. Depending on the conversationType, this could be a user ID, discussion group ID, or group ID.
A List of message type identifiers. For example, a List containing RC:TxtMsg, RC:ImgMsg, RC:VcMsg, etc.
The timestamp of the current message.
The number of messages to retrieve.
The direction of the messages to retrieve relative to the current message RongCommonDefine.GetMessageDirection Using the current message as the starting point, messages earlier than the current message are FRONT, otherwise they are BEHIND.
The callback for retrieving historical messages, ordered from newest to oldest.
Retrieves the latest message entities of a specified type, before a specified message, and within a specified count in a conversation.
Parameters
The type of conversation. Refer to .
The ID of the conversation. Depending on the conversationType, this could be a user ID, discussion group ID, or group ID.
The ID of the last message. Retrieves the `count` messages before this message. Set to -1 for the first call when no messages exist.
The number of messages to retrieve.
The callback for retrieving historical messages, ordered from newest to oldest.
Searches for messages before and after the specified message in a conversation.
The returned message list will include the specified message. The messages are ordered from newest to oldest.
Parameters
The specified conversation type.
The specified conversation ID.
The send time of the specified message, which cannot be 0.
The number of messages before the specified message.
The number of messages after the specified message.
Callback for search results.
When loading more messages, the returned data includes the current message; for example: if the current message ID is 500, before = 0, and after = 10, the returned messages will be 510 - 500, sorted in descending order by message ID.
Deprecated
Retrieves a list of messages that meet the specified criteria in the conversation.
Return
Historical messages, ordered from newest to oldest.
Deprecated
This method is deprecated. It is recommended to use getHistoryMessages or getHistoryMessages asynchronous methods instead.
Parameters
The type of conversation Conversation.ConversationType.
The ID of the conversation. Depending on the conversationType, this could be a user ID, discussion group ID, or group ID.
The ID of the last message. Retrieves the `count` messages before this message. Set to `-1` for the first call when no messages are available.
The number of messages to retrieve.
Deprecated
Retrieves a list of messages in the conversation that meet the specified criteria.
Return
A list of historical messages, sorted from newest to oldest.
Deprecated
This method is deprecated. It is recommended to use getHistoryMessages or getHistoryMessages asynchronous methods instead.
Parameters
The type of conversation Conversation.ConversationType.
The ID of the conversation. Depending on the conversationType, this could be a user ID, discussion group ID, or group ID.
The message type identifier.
The ID of the last message. Retrieves `count` messages before this message. Set to `-1` for the first call when no messages exist.
The number of messages to retrieve.