getConversationsFromTagByPage static method
分页获取本地指定标签下会话列表
tagId
标签 id
ts
会话中最后一条消息时间戳
count
获取数量(20<= count <=100)
Implementation
static Future getConversationsFromTagByPage(String? tagId, int ts, int count, Function(int? code, List conversationList)? finished) async {
if (tagId == null) {
developer.log("getConversationsFromTagByPage fail: ctagId is null", name: "RongIMClient");
return null;
}
Map paramMap = {"tagId": tagId, "ts": ts, "count": count};
Map resultMap = await _channel.invokeMethod(RCMethodKey.GetConversationsFromTagByPage, paramMap);
int? code = resultMap["code"];
List? coversationList = resultMap["ConversationList"];
List conList = [];
if (coversationList != null) {
for (String conStr in coversationList) {
Conversation? con = MessageFactory.instance!.string2Conversation(conStr);
conList.add(con);
}
}
if (finished != null) {
finished(code, conList);
}
}