SetGroupTipsEventCallback
again (Details) and pass in null
to remove the group event listener.TencentIMSDK.SetGroupTipsEventCallback((GroupTipsElem message, string user_data)=>{// Process the callback logic});
GroupCreate
advanced API (Details), and the create_group_result_groupid
will be returned in the callback for successful creation.// Create a public group and specify group attributesCreateGroupParam param = new CreateGroupParam{create_group_param_group_id = "group_id",create_group_param_group_name = "group_name",create_group_param_group_type = TIMGroupType.kTIMGroup_Public,create_group_param_add_option = TIMGroupAddOption.kTIMGroupAddOpt_Any,};TIMResult res = TencentIMSDK.GroupCreate(param, (int code, string desc, CreateGroupResult result, string user_data)=>{// Process the async logic});
Type | Method for Joining a Group |
Work group (Work) | By invitation |
Public group (Public) | On request from the user and on approval from the group owner or admin |
Meeting group (Meeting) | Free to join |
Community (Community) | Free to join |
Audio-video group (AVChatRoom) | Free to join |
SetGroupTipsEventCallback
to add a group event listener in advance to receive the following group events.GroupJoin
(Details) to join the group.GroupTipsEventCallback
callback (Details).// Listen for the group join eventTencentIMSDK.SetGroupTipsEventCallback((GroupTipsElem message, string user_data)=>{// Process the callback logic});// Join a groupTIMResult res = TencentIMSDK.GroupJoin(group_id, "greeting message", (int code, string desc, string user_data)=>{// Process the async logic});
GroupInviteMember
(Details) to invite a user to the group.GroupTipsEventCallback
callback (Details).// Listen for the group invitation eventTencentIMSDK.SetGroupTipsEventCallback((GroupTipsElem message, string user_data)=>{// Process the callback logic});// Invite the `userA` user to join the `groupA` groupGroupInviteMemberParam param = new GroupInviteMemberParam{group_invite_member_param_group_id = "group_id",group_invite_member_param_identifier_array = new List<string> {"1234"} // Array of IDs of the users invited to the group};TIMResult res = TencentIMSDK.GroupInviteMember(param, (int code, string desc, List<GroupInviteMemberResult> result, string user_data)=>{// Process the async logic});
SetGroupTipsEventCallback
(Details).GroupJoin
(Details) to request to join the group.GroupHandlePendency
(Details) to approve/reject the request.SetGroupTipsEventCallback
callback (Details), notifying the group members that someone joined the group.GroupModifyGroupInfo
API (Details) to change the group join option (group_modify_info_param_add_option
) to "no group join allowed" or "no approval required".group_modify_info_param_add_option
has the following options:Group Join Option | Description |
TIMGroupAddOption.kTIMGroupAddOpt_Forbid | No users can join the group. |
TIMGroupAddOption.kTIMGroupAddOpt_Auth | Approval from the group owner or admin is required to join the group (default value). |
TIMGroupAddOption.kTIMGroupAddOpt_Any | Any user can join the group without approval. |
GroupGetJoinedGroupList
(Details) to get the list of joined work groups (Work), public groups (Public), meeting groups (Meeting), and communities (Community, which don't support the topic feature). Audio-video groups (AVChatRoom) and communities (Community, which support the topic feature) are not included in this list.// Get the joined groupsTIMResult res = TencentIMSDK.GroupGetJoinedGroupList((int code, string desc, List<GroupBaseInfo> info_list, string user_data)=>{// Process the async logic});
// Leave a groupTIMResult res = TencentIMSDK.GroupQuit(group_id, (int code, string desc, string user_data)=>{// Process the async logic});
// Disband a groupTIMResult res = TencentIMSDK.GroupDelete(group_id, (int code, string desc, string user_data)=>{// Process the async logic});
Was this page helpful?