/// <summary> /// 创建分组 /// </summary> /// <param name="code">分组唯一标志</param> /// <param name="name">分组名称</param> /// <param name="description">描述</param> /// <param name="cancellationToken"></param> /// <returns></returns> public async Task <Group> Create( string code, string name, string description = null, CancellationToken cancellationToken = default) { var param = new CreateGroupParam(code, name) { Description = description, }; var res = await client.Request <CreateGroupResponse>(param.CreateRequest(), cancellationToken); return(res.Result); }
public static void GroupCreate() { CreateGroupParam param = new CreateGroupParam(); param.create_group_param_group_id = "379595063308chat11_chatroom"; param.create_group_param_group_name = "name"; param.create_group_param_group_type = TIMGroupType.kTIMGroup_ChatRoom; param.create_group_param_add_option = TIMGroupAddOption.kTIMGroupAddOpt_Any; param.create_group_param_notification = "create_group_param_notification"; param.create_group_param_introduction = "create_group_param_introduction"; param.create_group_param_face_url = "https://yq.sukeni.com/Logo.jpg"; TIMResult res = TencentIMSDK.GroupCreate(param, addAsyncDataToConsole); Utils.Log(((int)res).ToString()); addDataToConsole(res); }
public void GroupCreateSDK() { print(GroupID.text); print(GroupName.text); print(GroupType.value); CreateGroupParam param = new CreateGroupParam(); param.create_group_param_group_id = GroupID.text; param.create_group_param_group_name = GroupName.text; param.create_group_param_group_type = (TIMGroupType)GroupType.value; param.create_group_param_add_option = TIMGroupAddOption.kTIMGroupAddOpt_Any; param.create_group_param_notification = "create_group_param_notification"; param.create_group_param_introduction = "create_group_param_introduction"; param.create_group_param_face_url = "https://yq.sukeni.com/Logo.jpg"; TIMResult res = TencentIMSDK.GroupCreate(param, Utils.addAsyncStringDataToScreen(GetResult)); Result.text = Utils.SynchronizeResult(res); }
public CreateGroupResult CreateGroup(CreateGroupParam createGroupParam) { var result = _restHelper.Post <CreateGroupParam, CreateGroupResult>("/api/v1/groups.create", createGroupParam, _headers); return(result); }
/// <summary> /// 创建群组 /// </summary> /// <param name="createGroupParam">创建群组的参数</param> /// <param name="handler">创建群组成功与否的回调</param> public static TIMResult IMGroupCreate(CreateGroupParam createGroupParam, GroupCreateDelgate handler = null) { var ptr = DelegateConverter.ConvertToIntPtr(handler); return((TIMResult)TIMClientAPIDef.TIMGroupCreate(JsonConvert.SerializeObject(createGroupParam), GroupCreateResultCallBack, ptr)); }