SDKsReact Native
Invite users to group
Invite one or more users to join a specified group using the OpenIM React Native SDK.
Invite one or more users to join a designated group:
await OpenIMSDK.inviteUserToGroup({
groupID: 'group-001',
reason: 'Inviting to join project discussion',
userIDList: ['user-002', 'user-003'],
});Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
groupID | string | Yes | Target group ID. |
reason | string | Yes | Invitation greeting or note. Pass empty string "" if not provided. |
userIDList | string[] | Yes | Array of user IDs to invite into the group. |
Return value
A resolved Promise confirms that the invitation request was submitted to the server.
When invited users enter the group directly (or after approval based on group policies), the OnGroupMemberAdded event is emitted. Add member items into the group member list using the composite key groupID:userID. For complete event listeners, see Get group member list by page.
Was this page helpful?