IMSDK
IM features a comprehensive suite of solutions including global access, one-to-one chat, group chat, message push, profile and relationship chain hosting, and account authentication. It also provides complete app access and backend management APIs.
V2TIMGroupInfo

Public Member Functions

 V2TIMGroupInfo ()
 
String getGroupID ()
 
void setGroupID (String groupID)
 
String getGroupType ()
 
void setGroupType (String groupType)
 
String getGroupName ()
 
void setGroupName (String groupName)
 
String getNotification ()
 
void setNotification (String notification)
 
String getIntroduction ()
 
void setIntroduction (String introduction)
 
String getFaceUrl ()
 
void setFaceUrl (String faceUrl)
 
boolean isAllMuted ()
 
void setAllMuted (boolean isAllMuted)
 
String getOwner ()
 
long getCreateTime ()
 
int getGroupAddOpt ()
 
void setGroupAddOpt (int addOpt)
 
void setCustomInfo (Map< String, byte[]> customInfoMap)
 
Map< String, byte[]> getCustomInfo ()
 
long getLastInfoTime ()
 
long getLastMessageTime ()
 
int getMemberCount ()
 
int getOnlineCount ()
 
long getMemberMaxCount ()
 
int getRole ()
 
int getRecvOpt ()
 
long getJoinTime ()
 

Static Public Attributes

static final int V2TIM_GROUP_ADD_FORBID = 0
 
static final int V2TIM_GROUP_ADD_AUTH = 1
 
static final int V2TIM_GROUP_ADD_ANY = 2
 

Constructor & Destructor Documentation

◆ V2TIMGroupInfo()

V2TIMGroupInfo ( )
inline

Member Function Documentation

◆ getGroupID()

String getGroupID ( )
inline

Get the group ID

Returns
Group ID

◆ setGroupID()

void setGroupID ( String  groupID)
inline

Set the group ID. This operation can be performed only during group creation or group information modification.

Attention
The custom group ID must be printable ASCII characters (0x20-0x7e) with a maximum length of 48 bytes. It cannot begin with @TGS# so as to avoid confusion with the default group IDs assigned by IM.
Parameters
groupIDGroup ID

◆ getGroupType()

String getGroupType ( )
inline

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
groupTypeGroup type

◆ getGroupName()

String getGroupName ( )
inline

Get the group name

Returns
Group name

◆ setGroupName()

void setGroupName ( String  groupName)
inline

Set the group name. This operation can be performed only during group creation or group information modification.

Attention
The maximum length of the group name is 30 bytes.
Parameters
groupNameGroup name

◆ getNotification()

String getNotification ( )
inline

Get the group notice

◆ setNotification()

void setNotification ( String  notification)
inline

Set the group notice. This operation can be performed only during group creation or group information modification.

Attention
The maximum length of the group notice is 300 bytes.
Parameters
notificationGroup notice

◆ getIntroduction()

String getIntroduction ( )
inline

Get the group introduction

◆ setIntroduction()

void setIntroduction ( String  introduction)
inline

Set the group introduction. This operation can be performed only during group creation or group information modification.

Attention
The maximum length of the group introduction is 240 bytes.
Parameters
introductionGroup introduction

◆ getFaceUrl()

String getFaceUrl ( )
inline

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 only during group creation or group information modification.

Attention
The maximum length of the group profile photo URL is 100 bytes.
Parameters
faceUrlGroup profile photo URL

◆ isAllMuted()

boolean isAllMuted ( )
inline

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
isAllMutedWhether to mute all group members

◆ getOwner()

String getOwner ( )
inline

Get the group owner

Returns
Group owner ID

◆ getCreateTime()

long getCreateTime ( )
inline

Get the group creation time

Returns
Group creation time

◆ getGroupAddOpt()

int getGroupAddOpt ( )
inline

Get the group joining approval type

Returns

◆ setGroupAddOpt()

void setGroupAddOpt ( int  addOpt)
inline

Set the group joining option. This operation can be performed only during group creation or group information modification and applies only to public groups.

  • 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
addOptGroup joining option

◆ setCustomInfo()

void setCustomInfo ( Map< String, byte[]>  customInfoMap)
inline

To set a custom group field, perform the following steps:

1. Go to the console (Feature Configuration -> Custom Group Field) to set the key value of the custom group field. The key field is of the String type, with a maximum length of 16 bytes.

2. Call the setGroupInfo API to set the field. The field value is of the NSData type, with a maximum length of 512 bytes.

Attention
This field is mainly used for compatibility with V1 and V2. If you are using V2 APIs, you are advised to use the initGroupAttributes API to set group attributes because the API is more flexible (requiring no configuration in the console) and supports a larger storage capacity (up to 16 KB). You are advised to use the initGroupAttributes API to set group attributes because the API is more flexible (requiring no configuration in the console) and supports a larger storage capacity (up to 16 KB).

◆ getCustomInfo()

Map<String, byte[]> getCustomInfo ( )
inline

Get custom group fields

◆ getLastInfoTime()

long getLastInfoTime ( )
inline

Get the latest group data modification time of the group

Returns

◆ getLastMessageTime()

long getLastMessageTime ( )
inline

Get the last time the group sends a message

Returns

◆ getMemberCount()

int getMemberCount ( )
inline

Get the number of members that have joined the group

Returns

◆ getOnlineCount()

int getOnlineCount ( )
inline

Get the number of online group members

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 see: https://intl.cloud.tencent.com/document/product/1047/33529

◆ getRole()

int getRole ( )
inline

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()

int getRecvOpt ( )
inline

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

◆ getJoinTime()

long getJoinTime ( )
inline

Get the time when the current user joins the group. The time is automatically generated by the system and cannot be set.

Returns
Group joining time, in seconds

Field Documentation

◆ 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