getLatestMessages

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

获取指定会话的最新消息。

Parameters

conversationType

会话类型 io.rong.imlib.model.Conversation.ConversationType 。

targetId

会话 id。根据不同的 conversationType,可能是用户 id、讨论组 id、群组 id 或聊天室 id。

count

需要获取的消息数量。

callback

获取最新消息的回调,按照时间顺序从新到旧排列,如果会话中的消息数量小于参数 count 的值,会将该会话中的所有消息返回。