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:callType:mediaType:
Start a group call with extra configurationstartCall:callType:mediaType:pushConfig:extra: or startCall:callType:mediaType:option:
Join an existing group calljoinCall:
Invite participantsinviteToCall: / inviteToCall:pushConfig:extra:
End the callendCall / endCall: / endCall:pushConfig:

Start a group call

Set callType to NCCallMultipleType for group calls.

Objective C
[[NCCallEngine sharedInstance] startCall:@[@"user_a", @"user_b"]
callType:NCCallMultipleType
mediaType:NCCallAudioVideoMediaType];

If you need to pass push fields, business extra, or a group targetId together, use NCCallOption:

Objective C
NCCallOption *option = [NCCallOption new];
option.extra = @"business-extra";
option.targetId = @"group-id";

[[NCCallEngine sharedInstance] startCall:@[@"user_a", @"user_b"]
callType:NCCallMultipleType
mediaType:NCCallAudioVideoMediaType
option:option];

The asynchronous result is returned through didStartCall:callId:busylineUsers: in NCCallAPIResultDelegate.

Receive and join a group call

Invited users receive the incoming call through didCallReceived:extra::

Objective C
- (void)didCallReceived:(NCCallSession *)session extra:(NSString *)extra {
[[NCCallEngine sharedInstance] acceptCall:session.callId];
}

If you already have a valid callId, you can also call joinCall: to actively join an ongoing group call.

Invite additional users

Objective C
[[NCCallEngine sharedInstance] inviteToCall:@[@"user_c", @"user_d"]];

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";

[[NCCallEngine sharedInstance] inviteToCall:@[@"user_c"]
pushConfig:pushConfig
extra:@"invite-extra"];

The result is returned through didInviteToCall:callId:userIds:busylineUsers:. Other participants receive didRemoteUserInvited:inviteeUserList: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 didCallTypeChanged:callType::

Objective C
- (void)didCallTypeChanged:(NSString *)callId callType:(NCCallType)callType {
if (callType == NCCallMultipleType) {
// 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 sharedInstance] setVideoView:localView];

NCCallRemoteVideoView *remoteView = [NCCallRemoteVideoView new];
remoteView.userId = @"user_a";
remoteView.renderMode = NCCallRenderModeAspectFit;
remoteView.isTiny = NO;
[[NCCallEngine sharedInstance] setVideoView:remoteView];

If you no longer need to show a remote participant, call:

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

End the call and manage call logs

  • To leave the current group call, call endCall, endCall:, or endCall:pushConfig:.
  • The result is returned through didEndCall:callId:.
  • Query call history with getHistoryCallLogsWithTime:count:order:.
  • Query ongoing calls with getOngoingCallLogs.