getConversationListByFilter
功能介绍
获取会话列表的高级接口
参数详解
返回值
V2TimValueCallback<V2TimConversationResult>
{
code : int
desc : String
data : {
conversationList : List<V2TimConversation>
isFinished : bool
nextSeq : String
}
}
返回值详解
代码示例
V2TimConversationListFilter filter = V2TimConversationListFilter(
conversationType: 0,
nextSeq: 0,
count: 10,
markType: 0,
groupName: "groupName");
V2TimValueCallback<V2TimConversationResult> getConversationListByFilterRes =
await TencentImSDKPlugin.v2TIMManager
.getConversationManager()
.getConversationListByFilter(filter: filter);
if (getConversationListByFilterRes.code == 0) {
bool? isFinished =getConversationListByFilterRes.data?.isFinished;
String? nextSeq =getConversationListByFilterRes.data?.nextSeq;
List<V2TimConversation?>? conversationList =getConversationListByFilterRes.data?.conversationList;
if (!isFinished!) {
V2TimConversationListFilter nextFilter = V2TimConversationListFilter(
conversationType: 0,
nextSeq: int.parse(nextSeq!),
count: 10,
markType: 0,
groupName: "groupName");
V2TimValueCallback<V2TimConversationResult> nextConversationListRes =
await TencentImSDKPlugin.v2TIMManager
.getConversationManager()
.getConversationListByFilter(
filter: nextFilter);
}
getConversationListByFilterRes.data?.conversationList?.forEach((element) {
element
?.conversationID;
element?.draftText;
element?.draftTimestamp;
element?.faceUrl;
element?.groupAtInfoList;
element?.groupID;
element?.groupType;
element?.isPinned;
element?.lastMessage;
element?.orderkey;
element?.recvOpt;
element
?.showName;
element?.type;
element?.unreadCount;
element?.userID;
});
}