Group

Group

Group object, used to describe the properties of a group, including the group type, group announcement, and group creation time

Disused:
  • Note that memberNum and maxMemberNum are disused from v2.8.0. Please use memberCount and maxMemberCount instead.
Properties:
Name Type Description
groupID String

Unique identifier of the group. Each group ID must be unique in the app. The prefix is @TGS#, and custom group IDs can also be used in the app.

name String

Name of the group. The maximum length is 30 bytes and cannot be adjusted.

avatar String

URL of the group's profile photo. The maximum length is 100 bytes and cannot be adjusted.

type String

Group type. The current SDK supports the following types:

Type Description
TIM.TYPES.GRP_WORK Work group
TIM.TYPES.GRP_PUBLIC Public group
TIM.TYPES.GRP_MEETING Meeting group
TIM.TYPES.GRP_AVCHATROOM Audio-video group
introduction String

Introduction of the group. The maximum length is 120 bytes and cannot be adjusted.

notification String

Group announcement. The maximum length is 150 bytes and cannot be adjusted.

ownerID String

Group owner ID

createTime Number

Group creation time

infoSequence Number

This value increases every time the group information changes.

lastInfoTime Number

Time of the last change to group information

selfInfo Object

Information of the current user in the group

Properties
Name Type Description
role String

Role

messageRemindType String

Message receiving options:

  • TIM.TYPES.MSG_REMIND_ACPT_AND_NOTE: the SDK receives a message and throws a message receiving event to notify the access side, which then sends a notification.
  • TIM.TYPES.MSG_REMIND_ACPT_NOT_NOTE: the SDK receives a message and throws a message receiving event to notify the access side, which then does not send any notifications.
  • TIM.TYPES.MSG_REMIND_DISCARD: the SDK rejects a message.
joinTime Number

Time when the member joined the group

nameCard String

Group name card

lastMessage Object

Last message of the group. Note that if the group is not on the conversation list, only lastTime of this object has a value, and the other values are null.

Properties
Name Type Description
lastTime Number

Timestamp of the last message of the group, in seconds

lastSequence Number

Sequence number of the last message of the current group

fromAccount Number

Source user of the last message of the group

messageForShow Number

Brief content of the last message of the group to be displayed. If the message is a text message, the original content of the message is displayed. If the message is an image message, "[image]" is displayed.

nextMessageSeq Number

Sequence number of the next message in the group chat. Every message in the group chat has a unique sequence number. Sequence numbers are consecutive numbers based on the sequence of sent messages. With every message sent in the group chat, nextMessageSeq (starting from 1) increases by 1.

memberNum Number

(Disused) Number of current members

memberCount Number

Number of current members

maxMemberNum Number

(Disused) Maximum number of members

maxMemberCount Number

Maximum number of members

muteAllMembers Boolean

Whether to mute all. true: mute all; false: unmute all. Supported from v2.6.2.

joinOption String

Group joining option:

  • TIM.TYPES.JOIN_OPTIONS_FREE_ACCESS: allow free group joining. This is the fixed value for audio-video groups.
  • TIM.TYPES.JOIN_OPTIONS_NEED_PERMISSION: require approval for group joining.
  • TIM.TYPES.JOIN_OPTIONS_DISABLE_APPLY: forbid group joining. This is the fixed value for work groups.
groupCustomField Array.<Object>

Group custom field. By default, this field is not available. To learn how to enable group-level custom fields, see Custom Fields.

Properties
Name Type Description
key String

Key of the group custom field

value String

Value of the group custom field