Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • GroupManager

Index

Group callbacks

TIMSetGroupAttributeChangedCallback

  • brief

    Set the callback for group attribute changes

    note

    If the attributes of a group you have joined are modified, all attributes of the group are returned (all members of the group can receive them).

    Parameters

    Returns Promise<any>

TIMSetGroupTipsEventCallback

  • brief

    Set the callback for group system messages

    note

    Group system message events include joining a group, leaving a group, being kicked out of a group, setting an admin, canceling an admin, modifying group information, and modifying group member information. These messages are sent to all group members.

    Parameters

    Returns Promise<any>

Create a group

TIMGroupCreate

  • brief

    Create a group

    note

    You can specify a group ID when creating a group. If no group ID is specified, the IM server will generate a unique ID to facilitate subsequent operations. The callback set by this API returns the group ID.

    Parameters

    Returns Promise<commonResponse>

    Promise response: { code, desc, json_param, user_data }

Delete a group

TIMGroupDelete

  • brief

    Delete a group

    note

    Permission description: No one has the permission to delete a private group. The group owner can delete a public group, chat room, or audio-video group.

    Parameters

    Returns Promise<commonResponse>

    Promise response: { code, desc, json_param, user_data }

Join a group

TIMGroupInviteMember

TIMGroupJoin

  • brief

    Request to join a group

    note

    Permission description: Users cannot request to join a private group. Users can request to join a public group or chat room.

    • If approval is needed for a group, the group admin and owner will receive a system message for requesting to join the group. A user can join the group only after the group admin or owner approves the request. If any user is allowed to join the group according to the group configuration, the user can join the group directly. Any user can join an audio-video group.

    Parameters

    Returns Promise<commonResponse>

    Promise response: { code, desc, json_param, user_data }

Delete group members

TIMGroupDeleteMember

  • brief

    Delete group members

    note

    Permission description:

    Only the creator of a private group can delete group members. Only the admins and owner of a public group or chat room can delete group members. No group members can be deleted from an audio-video group.

    Parameters

    Returns Promise<commonResponse>

Search for the group list

TIMGroupSearchGroups

  • brief

    Search for the group list

    note

    The IM SDK will search for all groups whose names are contained in the search keyword list keywordList and return the group information list. The keyword list can contain up to 5 keywords.

    Parameters

    Returns Promise<commonResponse>

Search for the group member list

TIMGroupSearchGroupMembers

  • brief

    Search for the group member list

    note

    The IM SDK will search for all group members in the specified group ID list whose group member information (name card, friend remarks, nickname, or userID) is contained in the search keyword list keywordList and return the group ID and group member list map. The keyword list can contain up to 5 keywords.

    Parameters

    Returns Promise<commonResponse>

Group attribute APIs

TIMGroupDeleteGroupAttributes

TIMGroupGetGroupAttributes

TIMGroupInitGroupAttributes

TIMGroupSetGroupAttributes

Group information APIs

TIMGroupGetGroupInfoList

  • brief

    Get information about groups on a list

    note

    This API is used to obtain detailed information about groups in the specified group ID list. For more information about fields in the returned value, see below:

    // Group details
    static const char* kTIMGroupDetialInfoGroupId = "group_detial_info_group_id"; // String. Read-only. Group ID.
    static const char* kTIMGroupDetialInfoGroupType = "group_detial_info_group_type"; // Uint [TIMGroupType](). Read-only. Group type.
    static const char* kTIMGroupDetialInfoGroupName = "group_detial_info_group_name"; // String. Read-only. Group name.
    static const char* kTIMGroupDetialInfoNotification = "group_detial_info_notification"; // String. Read-only. Group notice.
    static const char* kTIMGroupDetialInfoIntroduction = "group_detial_info_introduction"; // String. Read-only. Group introduction.
    static const char* kTIMGroupDetialInfoFaceUrl = "group_detial_info_face_url"; // String. Read-only. Group profile photo URL.
    static const char* kTIMGroupDetialInfoCreateTime = "group_detial_info_create_time"; // Uint. Read-only. Group creation time.
    static const char* kTIMGroupDetialInfoInfoSeq = "group_detial_info_info_seq"; // Uint. Read-only. Sequence number of the group information. This value increases every time the group information changes.
    static const char* kTIMGroupDetialInfoLastInfoTime = "group_detial_info_last_info_time"; // Uint. Read-only. Last time when the group information was modified.
    static const char* kTIMGroupDetialInfoNextMsgSeq = "group_detial_info_next_msg_seq"; // Uint. Read-only. Sequence number of the latest group message.
    static const char* kTIMGroupDetialInfoLastMsgTime = "group_detial_info_last_msg_time"; // Uint. Read-only. Time of the latest group message.
    static const char* kTIMGroupDetialInfoMemberNum = "group_detial_info_member_num"; // Uint. Read-only. Number of current group members.
    static const char* kTIMGroupDetialInfoMaxMemberNum = "group_detial_info_max_member_num"; // Uint. Read-only. Maximum number of group members.
    static const char* kTIMGroupDetialInfoAddOption = "group_detial_info_add_option"; // Uint [TIMGroupAddOption](). Read-only. Group joining option.
    static const char* kTIMGroupDetialInfoOnlineMemberNum = "group_detial_info_online_member_num"; // Uint. Read-only. Number of online group members.
    static const char* kTIMGroupDetialInfoVisible = "group_detial_info_visible"; // Uint. Read-only. Whether group members are visible to external users.
    static const char* kTIMGroupDetialInfoSearchable = "group_detial_info_searchable"; // Uint. Read-only. Whether the group can be searched.
    static const char* kTIMGroupDetialInfoIsShutupAll = "group_detial_info_is_shutup_all"; // Bool. Read-only. Whether the group has muted all members.
    static const char* kTIMGroupDetialInfoOwnerIdentifier = "group_detial_info_owener_identifier"; // String. Read-only. ID of the group owner.
    static const char* kTIMGroupDetialInfoCustomInfo = "group_detial_info_custom_info"; // Array [GroupInfoCustemString](). Read-only. For more information, see [Cutsom Fields](https://cloud.tencent.com/document/product/269/1502#.E8.87.AA.E5.AE.9A.E4.B9.89.E5.AD.97.E6.AE.B5).

    // Result returned by the API for obtaining the list of joined groups (basic group information).
    static const char* kTIMGroupBaseInfoGroupId = "group_base_info_group_id"; // String. Read-only. Group ID.
    static const char* kTIMGroupBaseInfoGroupName = "group_base_info_group_name"; // String. Read-only. Group name.
    static const char* kTIMGroupBaseInfoGroupType = "group_base_info_group_type"; // Uint [TIMGroupType](). Read-only. Group type.
    static const char* kTIMGroupBaseInfoFaceUrl = "group_base_info_face_url"; // String. Read-only. Group profile photo URL.
    static const char* kTIMGroupBaseInfoInfoSeq = "group_base_info_info_seq"; // Uint. Read-only. Sequence number of the group information. This value increases every time the group information changes.
    static const char* kTIMGroupBaseInfoLastestSeq = "group_base_info_lastest_seq"; // Uint. Read-only. Sequence number of the latest message of the group. Every message in the group has a unique sequence number. Sequence numbers are consecutive numbers based on the sequence of sent messages. With every message sent in the group, LastestSeq (starting from 1) increases by 1.
    static const char* kTIMGroupBaseInfoReadedSeq = "group_base_info_readed_seq"; // Uint. Read-only. Sequence number of the read message in the user group.
    static const char* kTIMGroupBaseInfoMsgFlag = "group_base_info_msg_flag"; // Uint. Read-only. Message receiving option.
    static const char* kTIMGroupBaseInfoIsShutupAll = "group_base_info_is_shutup_all"; // Bool. Read-only. Whether the current group has muted all members.
    static const char* kTIMGroupBaseInfoSelfInfo = "group_base_info_self_info"; // Object [GroupSelfInfo](). Read-only. Personal information of the current user in the group.

    Parameters

    Returns Promise<commonResponse>

    The return of get_groups_info_result_code TIM_SUCC indicates that the interface call is successful (only when the interface returns TIM_SUCC, the callback cb will be called), and other values ​​indicate that the interface call failed. For the definition of each return value, please refer to TIMResult

TIMGroupGetJoinedGroupList

  • brief

    Get the list of groups that a user has joined

    note

    Permission description: You can call this API to obtain the list of groups that you have joined. This API can only obtain the list of some audio-video groups that a user has joined.

    Parameters

    • Optional data: string

      User-defined data. The IM SDK only transfers the user data to the callback function cb without processing the data.

    Returns Promise<commonResponse>

TIMGroupGetMemberInfoList

  • brief

    Get the group member information list

    note

    Permission description:

    The member list of a group of any type can be obtained. The member list of an audio-video group contains only the group owner, admins, and some members.

    Parameters

    Returns Promise<commonResponse>

TIMGroupGetOnlineMemberCount

  • brief

    Get the number of online members of a group

    note

    Note:

    • Currently, this API is supported only by audio-video groups (AVChatRoom).
    • This API implements frequency limit checks. It can be called by the SDK for up to once per 60 seconds.

    Parameters

    Returns Promise<commonResponse>

TIMGroupGetPendencyList

  • brief

    Get the pending group request list   Pending group requests are those that are not handled, for example, requests to join a group or to invite a user to join a group.

    note

    Note:

    The group pending message here generally refers to all group-related operations that require approval. For example: add a group for approval, pull people into a group for approval, etc. Even after the review is approved or rejected, the piece of information can be pulled back through this interface, and the pulled information has a decision flag. UserA applies to join the group GroupA, then the group administrator can obtain the pending information. Since UserA does not have the approval authority, he does not need to obtain the pending information. If AdminA pulls UserA into GroupA, UserA can pull the pending related information, because the pending information is pending approval by UserA Permission description: Only the approver has the permission to pull related pending information. kTIMGroupPendencyOptionStartTime Set the pull timestamp, fill in 0 for the first request, and then fill in the timestamp specified by the GroupPendencyResult key kTIMGroupPendencyResultNextStartTime (refer to below) returned by the server. kTIMGroupPendencyOptionMaxLimited The recommended number of pulls, the server can return more or less as needed, and cannot be used as a sign of completion * @return {Promise}

    // Result of getting the group pending request list (GroupPendencyResult JsonKey).
    kTIMGroupPendencyResultNextStartTime = "group_pendency_result_next_start_time"; // Number. Read-only. Start timestamp of the next pull. The value 0 returned by the server indicates that no more data is available. Otherwise, the timestamp is used as the start timestamp of the next data pull.
    kTIMGroupPendencyResultReadTimeSeq = "group_pendency_result_read_time_seq"; // Number. Read-only. Report timestamp of the read pending request.
    kTIMGroupPendencyResultUnReadNum = "group_pendency_result_unread_num"; // Number. Read-only. Number of unread pending requests.
    kTIMGroupPendencyResultPendencyArray = "group_pendency_result_pendency_array"; // Array [GroupPendency](). Read-only. Group pending request list.

    Parameters

    Returns Promise<commonResponse>

TIMGroupHandlePendency

  • brief

    Handle pending group requests

    note

    Note:

    For the pending information of the group, ImSDK has added a processing interface. Approvers can choose to approve or reject a single message. Pending messages that have been processed successfully cannot be processed again. A pending message is required when handling pending messagesHandlePendencyParams, Can be used in the interfaceTIMGroupGetPendencyListThe returned pending information list saves the pending information. Pass the GroupPendency into the key group_handle_pendency_param_pendency when processing the pending information.

    Parameters

    Returns Promise<commonResponse>

TIMGroupModifyGroupInfo

  • brief

    Modify group information

    note

    Description of the permissions for modifying the group owner (group ownership transfer): Only the group owner has the permission to transfer the group ownership. The ownership of an audio-video group cannot be transferred. Description of the permissions for modifying other group information: Only the group owner or admin of a public group, chat room, or audio-video group can modify the group introduction. Any members in a private group can modify the group introduction.

    Parameters

    Returns Promise<commonResponse>

TIMGroupModifyMemberInfo

  • brief

    Modify group member information

    note

    Permission description:

    Only the group owner or admin can modify group member roles. The roles of members in an audio-video group cannot be modified. Only the group owner or admin can mute group members. kTIMGroupModifyMemberInfoParamModifyFlag can be set by bit or set to multiple values. Different flags are used to set different keys. For more information, see ModifyMemberInfoParams.

    Parameters

    Returns Promise<commonResponse>

TIMGroupReportPendencyReaded

  • brief

    Report that pending requests are read

    note

    Group pending requests generated earlier than time_stamp are set to the read state. After the read state is reported, these pending requests can still be obtained. However, you can determine whether these pending requests have been read based on the read timestamp.

    Parameters

    Returns Promise<commonResponse>

Leave a group

TIMGroupQuit

  • brief

    Leave a group

    note

    Permission description: All members in a private group can leave the group. The group owner cannot leave a public group, chat room, or audio-video group. When this API is called to leave a group with the specified groupId, parameters of the callback function cb can be used to determine whether the group leaving was successful.

    Parameters

    Returns Promise<commonResponse>

Generated using TypeDoc