Groups overview
Understand group profiles, members, applications, roles, and group events in OpenIM iOS SDK.
OpenIM manages multi-user chat scenarios through groups, encapsulating shared profiles, membership relations, and role-based permissions. The groupID uniquely identifies a group and is required whenever sending group messages, querying profiles, administering members, or handling join requests. Conversations in the chat list continue to use conversationID; maintain clear separation between both keys.
Core data types
| Type | Description |
|---|---|
OIMGroupInfo | Contains group name, avatar URL, announcement, owner user ID, join verification mode, member counts, and extension attributes. |
OIMGroupMemberInfo | Represents a member's profile within a specific group, including nickname, role, mute status, and join timestamp. |
OIMGroupApplicationInfo | Represents join applications and their administrative review states. |
Group roles are represented by the OIMGroupMemberRole enumeration: regular member (OIMGroupMemberRoleMember = 20), administrator (OIMGroupMemberRoleAdmin = 60), and group owner (OIMGroupMemberRoleOwner = 100). While client apps use these values to adjust UI controls, final permission enforcement is performed by the OpenIM server.
Group profile and lifecycle
- Create a group
- Update the group name, description, and avatar
- Publish or update a group announcement
- Set group join verification
- Set access to member profiles
- Set permission to add friends from a group
- Set the group extension field
- Apply to join a group
- Leave a group
- Dismiss a group
- Retrieve group profiles
- Search groups
Group members and applications
Group moderation
State updates
Listen to group profile changes, member joins/leaves, and group dissolutions by implementing the OIMGroupListener protocol:
- (void)startGroupEvents {
[[OIMManager callbacker] addGroupListener:self];
}
- (void)stopGroupEvents {
[[OIMManager callbacker] removeGroupListener:self];
}
- (void)onJoinedGroupAdded:(OIMGroupInfo *)group {
[self upsertGroup:group];
}
- (void)onJoinedGroupDeleted:(OIMGroupInfo *)group {
[self removeGroupID:group.groupID];
}
- (void)onGroupInfoChanged:(OIMGroupInfo *)group {
[self upsertGroup:group];
}
- (void)onGroupDismissed:(OIMGroupInfo *)group {
[self markDismissed:group.groupID];
}Retain a stable OIMGroupListener instance and pass the exact same reference when adding or removing listeners. Merge group state using groupID as the primary key. Method return callbacks, asynchronous delegate notifications, and local cache calibrations represent three distinct stages.
For member events, refer to Retrieve group members overview. For join request events, refer to Group applications overview.
Was this page helpful?