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.
Related APIs
| Capability | API |
|---|---|
| Start a group call | startCall:callType:mediaType: |
| Start a group call with extra configuration | startCall:callType:mediaType:pushConfig:extra: or startCall:callType:mediaType:option: |
| Join an existing group call | joinCall: |
| Invite participants | inviteToCall: / inviteToCall:pushConfig:extra: |
| End the call | endCall / endCall: / endCall:pushConfig: |
Start a group call
Set callType to NCCallMultipleType for group calls.
[[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:
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::
- (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
[[NCCallEngine sharedInstance] inviteToCall:@[@"user_c", @"user_d"]];
If you need to include push fields and extra:
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::
- (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:
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:
[[NCCallEngine sharedInstance] removeVideoView:@"user_a"];
End the call and manage call logs
- To leave the current group call, call
endCall,endCall:, orendCall:pushConfig:. - The result is returned through
didEndCall:callId:. - Query call history with
getHistoryCallLogsWithTime:count:order:. - Query ongoing calls with
getOngoingCallLogs.