Skip to main content

Generate Token

Generate token method takes two parameter authToken and sessionId. authToken: User can get the auth token from CometChatSDK that has a static method getUsersAuthToken(). sessionId: Any random string.
Settings The CallSettings class is the most important class when it comes to the implementation of the Calling feature. This is the class that allows user to customize the overall calling experience. The properties for the call/conference can be set using the CallSettingsBuilder class. This will eventually give user an object of the CallSettings class which user can pass to the startCall() method to start the call. The mandatory parameters that are required to be present for any call/conference to work are:
  1. UIView i.e a view in which user want to show the calling view inside it.
  2. Video Settings.

Start Call

To start a call, user have to pass callToken, callSettings and callView. callToken In the success block of generateToken(), user get the callToken. callSettings CallSettings can be set from the CallSettingsBuilder callView callView is a UIView in which you want to display the call UI
Calling Events Listners To get calling events, User have to conform the “CallsEventsDelegate” delegate. For these events working, User have to pass “self” to setDelegate() in callSettingsBuilder.

MultiListener For Call Events

Through Multi Listener you can get Inn-call events in any class that accepts CallsEventsDelegate Add listener for a calls
Remove listener for a calls
On removing the listener, user will not get callbacks for call events for that particular unique ID associated class Custom Events In case user wish to achieve a completely customized UI for the Calling experience, user can do so by embedding default iOS buttons to the screen as per requirements and then use the below methods to achieve different functionalities for the embedded buttons. For the use case where user wish to align own custom buttons and not use the default layout provided by CometChat, user can embed the buttons in the layout and use the below methods to perform the corresponding operations: End Call User can end the call by using the CometChatCalls.endSession()

Switch Camera

User can end the call by using the CometChatCalls.switchCamera()

Audio Muted

User can end the call by using the audioMuted(true)
Audio Unmute User can end the call by using the audioMuted(false)
Pause Video User can end the call by using the videoPaused(true)

Unpause Video

User can end the call by using the videoPaused(false)
Set Audio Mode User can end the call by using the **setAudioMode(mode: "**_**MODE**_**")**

Enter PIP Mode

User can end the call by using the **enterPIPMode()**
Exit PIP Mode User can end the call by using the **exitPIPMode()**
SwitchToVideoCall User can end the call by using the **switchToVideoCall()**
Start Recording User can end the call by using the **startRecording()**
Stop Recording User can end the call by using the **stopRecording()**