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

Start a group call

Invite specified group members to join an audio or video group call.

Copy

Invoke signalingInviteInGroup() to invite specific group members to an audio or video call. This API delivers invitations strictly to the members listed in inviteeUserIDList; specifying groupID does not automatically invite all members of the group.

Parameters

ParameterTypeRequiredDescription
invitationOpenIMSignalingInvitationInfoYesThe signaling invitation configuration object.
invitation.inviterUserIDstringRecommendedThe user ID of the caller initiating the invitation.
invitation.inviteeUserIDListstring[]YesAn array of user IDs of the group members being invited.
invitation.groupIDstringYesThe target group identifier.
invitation.roomIDstringYesA unique room identifier generated for this group call session.
invitation.timeoutnumberYesRinging timeout duration in seconds.
invitation.mediaTypestringYesMedia type agreed upon by your application, such as 'audio' or 'video'.
invitation.sessionTypeOpenIMSessionTypeYesUse the session type matching the group conversation (typically OpenIMSessionTypeWriteGroup for working groups).
invitation.platformIDOpenIMPlatformRecommendedCurrent platform constant matching the one used during initSDK().
invitation.customDatastringNoOptional business payload string attached to the invitation.
offlinePushInfoOpenIMSignalingOfflinePushInfoNoPush notification configuration for offline group members.

Keep these group-specific guidelines in mind:

  • Pass the valid groupID of an active group.
  • Filter inviteeUserIDList to exclude the inviter's own user ID, empty values, and duplicate entries.
  • Generate a new, unique roomID for every call session rather than reusing groupID.

Code example

import {
  OpenIMSessionTypeWriteGroup,
  signalingInviteInGroup,
} from '@/uni_modules/unix-openim-sdk'

const invitation = {
  inviterUserID: currentUserID,
  inviteeUserIDList: selectedGroupMemberIDs,
  customData: JSON.stringify({ source: 'group-call' }),
  groupID,
  roomID: createCallRoomID(),
  timeout: 30,
  mediaType: 'video',
  sessionType: OpenIMSessionTypeWriteGroup,
  platformID: currentOpenIMPlatform,
}

const result = await signalingInviteInGroup({
  invitation,
  offlinePushInfo,
})

Return value

The Promise resolves with an OpenIMSignalingInviteResult | null object containing room credentials and busyLineUserIDList. Users listed in busyLineUserIDList were busy on other calls; this does not invalidate invitations sent to other available group members.

State changes after the call

A resolved Promise confirms that invitation requests were dispatched to OpenIMServer and that room credentials were created. It does not indicate that any group member has accepted. Merge call session state by roomID, and track individual member statuses by combining roomID with each member's userID. For ongoing participation updates, see Handle call events.