Invite users to group
Invite users to join an OpenIM group using the Flutter SDK.
Group members or administrators can invite a list of users to join a group. Enforce entry point controls in the UI based on group settings; final authorization and verification logic are handled by the server:
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
groupID | String | Yes | Target group ID. |
reason | String | Yes | Invitation description or application note. |
userIDList | List<String> | Yes | List of user IDs invited to join the group. |
Code example
await OpenIM.iMManager.groupManager.inviteUserToGroup(
groupID: groupID,
reason: 'Join project discussion',
userIDList: selectedUserIDs,
);Return value
A successful Future indicates that the invitation request was accepted by the server. Depending on the group's join verification policy, users are either admitted immediately or an application record is created for review.
State changes after the call
When users join directly, connected clients receive onGroupMemberAdded event notifications. Use groupID:userID as the key to merge new members into the local roster. For complete listener integration, see Retrieving group members overview.
Was this page helpful?