getLatestMessages

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

根据会话类型的目标 Id,回调方式获取最新的 N 条消息记录。

Parameters

conversationType

会话类型。

targetId

目标 Id。根据不同的 conversationType,可能是用户 Id、讨论组 Id、群组 Id 或聊天室 Id。

count

要获取的消息数量。

callback

获取最新消息记录的回调,按照时间顺序从新到旧排列。该回调在主线程中执行,请避免在回调中执行耗时操作,防止 SDK 线程阻塞。