Skip to main content

Group call

This page describes the public group calling capabilities in Nexconn Call SDK for iOS, including how to start a group call, join a call, invite participants, and handle call type upgrades.

CapabilityAPI
Start a group callstartCall: with NCCallStartCallParams
Join an existing group calljoinCall: with NCCallJoinCallParams
Invite participantsinviteToCall: with NCCallInviteToCallParams
End the callendCall: with NCCallEndCallParams

Start a group call

Set callType to NCCallTypeMultiple for group calls.

Objective C
NCCallStartCallParams *params =
[[NCCallStartCallParams alloc] initWithCalleeIds:@[ @"user_a", @"user_b" ]
callType:NCCallTypeMultiple
mediaType:NCCallMediaTypeAudioVideo];
[[NCCallEngine getInstance] startCall:params];

If you need to pass push fields, business extra, or a group targetId together, set them on NCCallStartCallParams after initialization:

Objective C
NCCallPushConfig *pushConfig = [NCCallPushConfig new];
pushConfig.pushTitle = @"New group call";
pushConfig.pushContent = @"Tap to join";

NCCallStartCallParams *params =
[[NCCallStartCallParams alloc] initWithCalleeIds:@[ @"user_a", @"user_b" ]
callType:NCCallTypeMultiple
mediaType:NCCallMediaTypeAudioVideo];
params.pushConfig = pushConfig;
params.extra = @"business-extra";
params.targetId = @"group-id";

[[NCCallEngine getInstance] startCall:params];

The asynchronous result is onStartCall: (NCCallStartCallResult) on NCCallAPIResultHandler.

Receive, accept, reject, or join a group call

Invited users receive the incoming call through onCallReceived::

Objective C
- (void)onCallReceived:(NCCallReceivedEvent *)event {
NCCallAcceptCallParams *accept =
[[NCCallAcceptCallParams alloc] initWithCallId:event.session.callId];
[[NCCallEngine getInstance] acceptCall:accept];
}

If you already have a valid callId, join with NCCallJoinCallParams:

Objective C
NCCallJoinCallParams *joinParams = [[NCCallJoinCallParams alloc] initWithCallId:callId];
[[NCCallEngine getInstance] joinCall:joinParams];

Invite additional users

Objective C
NCCallInviteToCallParams *invite =
[[NCCallInviteToCallParams alloc] initWithCalleeIds:@[ @"user_c", @"user_d" ]];
[[NCCallEngine getInstance] inviteToCall:invite];

If you need to include push fields and extra:

Objective C
NCCallPushConfig *pushConfig = [NCCallPushConfig new];
pushConfig.pushTitle = @"New call invitation";
pushConfig.pushContent = @"You're invited to join the current call";

NCCallInviteToCallParams *invite =
[[NCCallInviteToCallParams alloc] initWithCalleeIds:@[ @"user_c" ]];
invite.pushConfig = pushConfig;
invite.extra = @"invite-extra";

[[NCCallEngine getInstance] inviteToCall:invite];

The result is onInviteToCall: (NCCallInviteToCallResult; check result.userIds, result.busyLineUserList, and result.callId). Other participants receive onRemoteUserInvited: (NCCallRemoteUserInvitedEvent with event.callId, event.inviteeUserList, and event.inviterUserId).

Upgrade a 1-to-1 call to a group call

When a third participant is successfully invited into a 1-to-1 call, the SDK reports the upgraded call type through onCallTypeChanged::

Objective C
- (void)onCallTypeChanged:(NCCallTypeChangedEvent *)event {
if (event.callType == NCCallTypeMultiple) {
// The current session has been upgraded to a group call
}
}

Video views in a group call

Use NCCallLocalVideoView for the local preview and NCCallRemoteVideoView for remote participants:

Objective C
NCCallLocalVideoView *localView = [NCCallLocalVideoView new];
localView.userId = self.currentUserId;
localView.renderMode = NCCallRenderModeAspectFit;
[[NCCallEngine getInstance] setLocalVideoView:localView];

NCCallRemoteVideoView *remoteView = [NCCallRemoteVideoView new];
remoteView.userId = @"user_a";
remoteView.renderMode = NCCallRenderModeAspectFit;
remoteView.enableLowResolutionStream = NO;
[[NCCallEngine getInstance] setRemoteVideoView:@[ remoteView ]];

If you no longer need to show one or more remote participants, pass their user IDs in an array:

Objective C
[[NCCallEngine getInstance] removeVideoView:@[ @"user_a" ]];

End the call and manage call logs

  • Use [[NCCallEngine getInstance] getCurrentCallSession] to read the active callId.
  • To leave the current group call, build NCCallEndCallParams with the active callId and optional pushConfig, then call endCall:.
  • The async result is onEndCall: (NCCallEndCallResult).
  • Query call history with getHistoryCallLogs: and NCCallGetHistoryCallLogsParams.
  • Query ongoing calls with getOngoingCallLogs.