◆ V2TIMGroupInfo()
◆ getGroupID()
Get the group ID
- Returns
- Group ID
◆ setGroupID()
void setGroupID |
( |
String |
groupID | ) |
|
|
inline |
Set the group ID. This operation can be performed during group creation.
- Attention
- A custom group ID must be printable ASCII characters (0x20-0x7e) with a maximum length of 48 bytes. To avoid confusion with the default group IDs assigned by Chat, do not start the custom ID with @TGS.
- Parameters
-
◆ getGroupType()
Get the group type
- Returns
- Group type
◆ setGroupType()
void setGroupType |
( |
String |
groupType | ) |
|
|
inline |
Set the group type. This operation can be performed only during group creation.
- Parameters
-
◆ setSupportTopic()
void setSupportTopic |
( |
boolean |
supportTopic | ) |
|
|
inline |
Whether to enable topic creation for a community group
◆ isSupportTopic()
boolean isSupportTopic |
( |
| ) |
|
|
inline |
Get whether a community group supports topic creation
◆ getGroupName()
Get the group name
- Returns
- Group name
◆ setGroupName()
void setGroupName |
( |
String |
groupName | ) |
|
|
inline |
Set the group name. This operation can be performed during group creation or group information modification.
- Attention
- The maximum length of the group name is 100 bytes, encoded in UTF-8.
- Parameters
-
◆ getNotification()
String getNotification |
( |
| ) |
|
|
inline |
◆ setNotification()
void setNotification |
( |
String |
notification | ) |
|
|
inline |
Set the group notice. This operation can be performed during group creation or group information modification.
- Attention
- The maximum length of the group notice is 400 bytes, encoded in UTF-8.
- Parameters
-
◆ getIntroduction()
String getIntroduction |
( |
| ) |
|
|
inline |
Get the group introduction
◆ setIntroduction()
void setIntroduction |
( |
String |
introduction | ) |
|
|
inline |
Set the group introduction. This operation can be performed during group creation or group information modification.
- Attention
- The maximum length of the group introduction is 400 bytes, encoded in UTF-8.
- Parameters
-
introduction | Group introduction |
◆ getFaceUrl()
Get the group profile photo URL
- Returns
- Group profile photo URL
◆ setFaceUrl()
void setFaceUrl |
( |
String |
faceUrl | ) |
|
|
inline |
Set the group profile photo URL. This operation can be performed during group creation or group information modification.
- Attention
- The maximum length of the group profile photo URL is 500 bytes, encoded in UTF-8.
- Parameters
-
faceUrl | Group profile photo URL |
◆ isAllMuted()
Get whether the current group has muted all members
- Returns
- true - All members are muted
◆ setAllMuted()
void setAllMuted |
( |
boolean |
isAllMuted | ) |
|
|
inline |
Set whether to mute all group members. This operation can be performed only during group information modification.
- Parameters
-
isAllMuted | Whether to mute all group members |
◆ getOwner()
Get the group owner
- Returns
- Group owner ID
◆ getCreateTime()
Get the group creation time
- Returns
- UTC timestamp of group creation
◆ getGroupAddOpt()
Get whether admin approval is required to join the group
- Returns
◆ setGroupAddOpt()
void setGroupAddOpt |
( |
int |
addOpt | ) |
|
|
inline |
Set the approval method for new members. This API can be called during group creation or group information modification. For work groups, the default value is V2TIM_GROUP_ADD_FORBID (users cannot request to join the group), which can be modified.
- V2TIM_GROUP_ADD_FORBID: forbid anyone to join the group
- V2TIM_GROUP_ADD_ANY: anyone can join the group
- V2TIM_GROUP_ADD_AUTH: group owner or admin approval is required for group joining
- Parameters
-
addOpt | The approval method for new group members |
◆ getGroupApproveOpt()
int getGroupApproveOpt |
( |
| ) |
|
|
inline |
Get whether admin approval is required to invite new members (supported in 7.1 and later versions)
- Returns
◆ setGroupApproveOpt()
void setGroupApproveOpt |
( |
int |
approveOpt | ) |
|
|
inline |
Set the approval method for inviting new group members. This API can be called during group creation or group information modification. Except for work groups, the default value for all group types is V2TIM_GROUP_ADD_FORBID (no one can be invited to the group). For AVChatRoom, Community, and topics, the default value cannot be modified.
- V2TIM_GROUP_ADD_FORBID: forbid anyone to join the group
- V2TIM_GROUP_ADD_ANY: anyone can join the group
- V2TIM_GROUP_ADD_AUTH: group owner or admin approval is required for group joining
- Parameters
-
approveOpt | The approval method for inviting new group members |
◆ setCustomInfo()
void setCustomInfo |
( |
Map< String, byte[]> |
customInfoMap | ) |
|
|
inline |
To set a custom group field, perform the following steps:
1. Go to the console (Configuration -> Group configuration -> Custom Group Field) to set the key (string, max 16 bytes) of the custom group field.
2. Call the setGroupInfo API to set the field. The HashMap field value length does not exceed 512 bytes.
- Attention
- This field mainly serves to make V1 and V2 compatible with each other. If you are using V2, we recommend you use the initGroupAttributes API to set group attributes. It is more flexible to use, does not require console configuration, and supports a larger size (up to 16 KB).
- The parameter customInfoMap must be a hashmap object.
◆ getCustomInfo()
Map<String, byte[]> getCustomInfo |
( |
| ) |
|
|
inline |
◆ getLastInfoTime()
Get the UTC timestamp when the group information was last modified
- Returns
◆ getLastMessageTime()
long getLastMessageTime |
( |
| ) |
|
|
inline |
Get the last time a message was sent in the group
- Returns
◆ getMemberCount()
Get the number of members that have joined the group
- Returns
◆ getOnlineCount()
Get the number of online group members (This has been deprecated. Please call getGroupOnlineMemberCount instead.)
- Returns
◆ getMemberMaxCount()
long getMemberMaxCount |
( |
| ) |
|
|
inline |
Get the maximum number of group members allowed to join
- Attention
- For details on the number of members allowed for each group type, please seehere.
◆ getRole()
Get the group member role. To switch the role, please call the setGroupMemberRole API.
- Returns
- Member roles: V2TIMGroupMemberFullInfo.V2TIM_GROUP_MEMBER_UNDEFINED: non-member V2TIMGroupMemberFullInfo.V2TIM_GROUP_MEMBER_ROLE_MEMBER: common member V2TIMGroupMemberFullInfo.V2TIM_GROUP_MEMBER_ROLE_ADMIN: group admin V2TIMGroupMemberFullInfo.V2TIM_GROUP_MEMBER_ROLE_OWNER: group owner
◆ getRecvOpt()
Get the current user's message receiving option in the group. To modify the group message receiving option, please call the setReceiveMessageOpt API.
- Returns
- Message receiving options: V2TIMMessage.V2TIM_RECEIVE_MESSAGE, V2TIMMessage.V2TIM_NOT_RECEIVE_MESSAGE, V2TIMMessage.V2TIM_RECEIVE_NOT_NOTIFY_MESSAGE V2TIMMessage.V2TIM_RECEIVE_NOT_NOTIFY_MESSAGE_EXCEPT_AT
◆ getJoinTime()
Get the time when the current user joined the group. The time is automatically generated by the system and cannot be modified.
- Returns
- Group joining time, in seconds
◆ isEnablePermissionGroup()
boolean isEnablePermissionGroup |
( |
| ) |
|
|
inline |
Get whether permission groups are enabled (only supported for community groups since v7.8)
◆ setEnablePermissionGroup()
void setEnablePermissionGroup |
( |
boolean |
enablePermissionGroup | ) |
|
|
inline |
Whether to enable permission groups (only supported for community groups since v7.8)
- Attention
- When permission groups are enabled, admin permissions will become invalid, and communities and topics will be managed by group permissions, topic permissions, and permission groups.
◆ getDefaultPermissions()
long getDefaultPermissions |
( |
| ) |
|
|
inline |
Get the default permissions (only supported for community groups since v7.8)
◆ setDefaultPermissions()
void setDefaultPermissions |
( |
long |
defaultPermissions | ) |
|
|
inline |
Set the default permissions (only supported for community groups since v7.8)
- Attention
- This API sets the default permissions for group members who have not joined any permission groups (only when permission groups are enabled, i.e., enablePermissionGroup = true).
◆ V2TIM_GROUP_ADD_FORBID
final int V2TIM_GROUP_ADD_FORBID = 0 |
|
static |
Forbid anyone to join the group
◆ V2TIM_GROUP_ADD_AUTH
final int V2TIM_GROUP_ADD_AUTH = 1 |
|
static |
Require admin approval
◆ V2TIM_GROUP_ADD_ANY
final int V2TIM_GROUP_ADD_ANY = 2 |
|
static |
Anyone can join