kickGroupMember static method

Future<V2TimCallback> kickGroupMember({
  1. required String groupID,
  2. required List<String> memberList,
  3. int? duration,
  4. String? reason,
})

Implementation

static Future<V2TimCallback> kickGroupMember({
  required String groupID,
  required List<String> memberList,
  int? duration,
  String? reason,
}) async {
  String param = json.encode({
    "group_delete_member_param_group_id": groupID,
    "group_delete_member_param_identifier_array": memberList,
    "group_delete_member_param_user_data": reason,
    "group_delete_member_param_duration": duration ?? 0,
  });
  String userData = Tools.generateUserData();
  Pointer<Uint8> user_data = Tools.string2PointerInt8(userData);
  Pointer<Uint8> json_group_delete_param = Tools.string2PointerInt8(param);
  int res = desktopSDK.D_TIMGroupDeleteMember(json_group_delete_param, user_data);
  if (res != TIMResult.TIM_SUCC) {
    return V2TimCallback.fromJson({
      "code": res,
      "desc": "",
    });
  } else {
    Map<String, dynamic> data = await getAsyncData(apiKey: userData);
    return V2TimCallback.fromJson({
      "code": data["code"],
      "desc": data["desc"],
    });
  }
}