Browse SDKs · uni-app / uni-app x
SDKsuni-app

Invite users to a group

OpenIM uni-app / uni-app x SDK guide for Invite users to a group.

Copy

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

ParameterTypeRequiredDescription
groupIDstringYesTarget group ID.
reasonstringYesInvitation comment; pass an empty string if unused.
userIDListstring[]YesUsers 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.