SDKsuni-app
Invite users to a group
OpenIM uni-app / uni-app x SDK guide for Invite users to a group.
Owners and administrators can manage members within the permissions granted by OpenIMServer. The client can use roleLevel to display controls, but the server remains authoritative.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
groupID | string | Yes | Target group ID. |
reason | string | Yes | Invitation comment; pass an empty string if unused. |
userIDList | string[] | Yes | Users to invite. |
import { inviteUserToGroup } from '@/uni_modules/unix-openim-sdk'
await inviteUserToGroup({ groupID, userIDList: ['user_b'], reason: 'Project collaboration' })Deduplicate userIDList. The reason can be visible to invitees, so do not include tokens or other sensitive information.
Promise success means that the server accepted the invitation request, not that every target joined. A policy requiring review can first produce an application event. Merge actual members through onGroupMemberAdded or query the member list again.
Was this page helpful?