GroupAVChat

To add Audio/Video Group Conference support in your app,

Include the class <MessageSDKFramework/GroupGroupAVChat.h> in the .h file of your class.

Initialize the GroupAVChat object:

GroupAVChat *groupAVChat =  [[GroupAVChat alloc] init];

Methods Available:

Method Description
sendConferenceRequest The method allows logged-in user to send a conference call request to a group
joinConference The method allows logged-in user to join a conference call
startConferenceInContainer The method allows loggedin user to start video conference
endConference The method allows you end the conference call
toggleAudio The method allows you to mute/unmute audio
toggleVideo The method allows you to mute/unmute video
switchCamera The method allows you to switch camera

sendConferenceRequest

The method allows logged-in user to send a conference call request to a group
Method Signature:

(void)sendConferenceRequest: (NSString *)groupID
                    success: (void (^)(NSDictionary *))success
                    failure: (void (^)(NSError *))failure;

Arguments:

groupID:

The id of a group in which you want to initiate a conference

success

A callback method.

Method Property Description
Method Signature: (void(^)(NSDictionary *response))response
Invocation: After audio/video conference request is sent successfully
Response: NSDictionary containing success response

Sample Response:

{
    callID = ec6a50f23eed63dc4cd1bf1498d9c4aa;
    groupid = 5;
    status = "Conference request sent successfully";
}

failure

A callback method

Method Property Description
Method Signature: (void(^)(NSError *error))failure
Invocation: If an error occurs while sending audio/video conference request
Response: NSError containing error code and message

Usage:

[groupAVChat sendConferenceRequest: @"5"
                           success: ^(NSDictionary *response){/* Code Block */}
                           failure: ^(NSError *error){/* Code Block */}
];

joinConference

Allows you to accept an video conference request when HAS STARTED A VIDEO CONVERSATION message is received in the onAVChatMessageReceived callback of subscribeWithMode method of CometChat class.
Method Signature:

(void)joinConference:(NSString *)callID
             success:(void (^)(NSDictionary *response))success
             failure:(void (^)(NSError *error))failure;

Arguments:

callID

The id of the conference call session

success

A callback method

Method Property Description
Method Signature: (void(^)(NSDictionary *response))response
Invocation: After sending video conference call acknowledgement successfully
Response: NSDictionary containing id of the user to whom video conference call acknowledgement has been sent

Sample Response:

{
   "status" = "Conference joined successfully";
}

failure

A callback method

Method Property Description
Method Signature: (void(^)(NSError *error))failure
Invocation: If an error occurs while joining audio/video conference
Response: NSError containing error code and message

Usage:

[groupAVChat joinConference: @"474a3e0baf0e3db251a2bc2a6a5b31a5"
                    success: ^(NSDictionary * response){/* Code Block */}
                    failure: ^(NSError * error){/* Code Block */}
];

startGroupAVChatWithCallID

Starts an video conference call within a container view. This function has to be called after sending/accepting video conference call request only.
Method Signature:

  (void)startConferenceInContainer: (NSString *)callID
                     containerView: (UIView *)container
                changeInAudioRoute: (void(^)(NSDictionary *audioRouteInformation))audioRouteInformation
                           failure: (void (^)(NSError *error))failure;

Arguments:

callID

The id of the conference call session as NSString datatype.

containerView

The reference of the UI Container in which video call UI should be placed as UIView datatype.

changeInAudioRoute

A callback method

Method Property Description
Method Signature: (void (^)(NSDictionary *route))audioRouteInformation
Invocation: Invoked with change in audio route
Response: NSDictionary containing audio route information

failure

A callback method

Method Property Description
Method Signature: (void(^)(NSError *error))failure
Invocation: If an error occurs while starting audio/video conference
Response: NSError containing error code and message

Usage:

[groupAVChat startConferenceInContainer: @"ec6a50f23eed63dc4cd1bf1498d9c4aa"
                          containerView: containerView
                     changeInAudioRoute: ^(NSDictionary *audioRouteInformation){/* Code Block */}
                                failure: ^(NSError *error){/* Code Block */}
];

endGroupAVChatWithUser

Ends an video conference corresponding to groupID and callID
Method Signature:

  (void)endConference: (NSString *)groupID
               callID: (NSString *)callID
              success: (void (^)(NSDictionary *response))success
              failure: (void (^)(NSError *error))failure;

Arguments:

groupID

The id of the group

callID

The id of a conference as NSString datatype.

success

A callback method.

Method Property Description
Method Signature: (void(^)(NSDictionary *response))response
Invocation: After ending video conference successfully
Response: NSDictionary containing success response

Sample Response:

{  
   "status"="Conference ended successfully";
}

failure

A callback method

Method Property Description
Method Signature: (void(^)(NSError *error))failure
Invocation: If an error occurs while ending video conference session
Response: NSError containing error code and message

Usage:

[groupAVChat endConference: @"5"
                    callID: @"ec6a50f23eed63dc4cd1bf1498d9c4aa"
                   success: ^(NSDictionary *response){/* Code Block */}
                   failure: ^(NSError *error){/* Code Block */}
];

toggleAudio

The method allows user to mute/unmute Audio
Method Signature:

(void)toggleAudio: (BOOL)audioControlFlag;

Arguments:

audioControlFlag:

A boolean value. YES indicates unmute and NO indicates mute
Usage:

[groupAVChat toggleAudio: YES];

toggleVideo

The method allows user to mute/unmute video
Method Signature:

(void)toggleVideo: (BOOL)videoControlFlag;

Arguments:

videoControlFlag

A boolean value. YES indicates unmute and NO indicates mute
Usage:

[groupAVChat toggleVideo: YES];

switchCamera

The method allows user to switch camera
Method Signature:

(void)switchCamera:

Usage:

[groupAVChat switchCamera];

Please refer ‎error codes for failure responses.

  • Was this helpful?
  • Yes   No