getTagsFromConversation static method

Future getTagsFromConversation(
  1. int? conversationType,
  2. String? targetId,
  3. dynamic finished(
    1. int? code,
    2. List conversationList
    )?
)

获取指定会话下的所有标签 conversationType 会话类型 targetId 会话 id

Implementation

static Future getTagsFromConversation(int? conversationType, String? targetId, Function(int? code, List conversationList)? finished) async {
  if (conversationType == null || targetId == null) {
    developer.log("getTagsFromConversation fail: conversationType is null or targetId is null", name: "RongIMClient");
    return null;
  }
  Map paramMap = {
    "conversationType": conversationType,
    "targetId": targetId,
  };
  Map resultMap = await _channel.invokeMethod(RCMethodKey.GetTagsFromConversation, paramMap);
  int? code = resultMap["code"];
  List? coversationTagList = resultMap["ConversationTagInfoList"];
  List tagList = [];
  if (coversationTagList != null) {
    for (String conStr in coversationTagList) {
      ConversationTagInfo? con = MessageFactory.instance!.string2ConversationTagInfo(conStr);
      tagList.add(con);
    }
  }
  if (finished != null) {
    finished(code, tagList);
  }
}