tencent cloud

Feedback

React Native

Last updated: 2024-02-06 17:49:39

    Feature Description

    The group profile refers to the information about the group, which can be obtained through the method in the TencentImSDKPlugin.v2TIMManager.getGroupManager() core class.
    

    Getting the Group Profile

    You can call getGroupsInfo (Details) to get the group profile. This API supports passing in multiple groupID values at a time to batch get group profiles.
    Below is the sample code:
    // Get the group profile
    const groupinfos = await groupManager.getGroupsInfo(["groupid1"]);
    

    Modifying the Group Profile

    Call setGroupInfo (Details) to modify the group profile.
    If you have called addGroupListener to add a group event listener in advance, after the group profile is modified, all the group members will receive the onGroupInfoChanged callback (Details).
    Member roles that can modify the group profile vary by group type as follows:
    Group Type
    Member Roles Allowed to Modify the Basic Group Information
    Work group (Work)
    All group members
    Public group (Public)
    Group owner and admin
    Meeting group (Meeting)
    Group owner and admin
    Community (Community)
    Group owner and admin
    Audio-video group (AVChatRoom)
    Group owner
    Below is the sample code:
    groupManager.setGroupInfo({
    groupAddOpt: GroupAddOptTypeEnum.V2TIM_GROUP_ADD_AUTH,
    // ...Other profiles
    });
    // Callback
    TencentImSDKPlugin.v2TIMManager.addGroupListener({
    onGroupInfoChanged: (groupID, changeInfos) => {
    // The group information was changed.
    },
    });

    Setting the Group Message Receiving Option

    Any group member can call the setGroupReceiveMessageOpt API (Details) to modify the group message receiving option.
    V2TIMReceiveMessageOpt has the following options:
    Message Receiving Option
    Description
    ReceiveMsgOptEnum.V2TIM_RECEIVE_MESSAGE
    Messages will be received when the user is online, and push notifications will be received when the user is offline.
    ReceiveMsgOptEnum.V2TIM_NOT_RECEIVE_MESSAGE
    No group messages will be received.
    ReceiveMsgOptEnum.V2TIM_RECEIVE_NOT_NOTIFY_MESSAGE
    Messages will be received when the user is online, and no push notifications will be received when the user is offline.
    Different V2TIMReceiveMessageOpt options can be used to implement group message notification muting:
    No group messages will be received. With the group message receiving option set to V2TIM_NOT_RECEIVE_MESSAGE, no group message will be received, and the conversation list will not be updated.
    Group messages will be received but will not be notified to the user, and a badge without the unread count will be displayed on the conversation list UI.
    1. The group message receiving option is set to V2TIM_RECEIVE_NOT_NOTIFY_MESSAGE.
    2. When the receiver receives a new group message and needs to update the conversation list, it can get the unread count through unreadCount (Details) in V2TIMConversation.
    3. The receiver displays a badge rather than the unread count when identifying the group message receiving option as V2TIM_RECEIVE_NOT_NOTIFY_MESSAGE based on the recvOpt (Details) of V2TIMConversation.
    Note:
    As this method requires the unread count feature, it applies only to work groups (Work) and public groups (Public).
    Below is the sample code:
    // Set the group message receiving option
    groupManager.setGroupInfo({
    groupAddOpt: GroupAddOptTypeEnum.V2TIM_GROUP_ADD_AUTH,
    });
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support