Overview
This guide demonstrates how to start One on One call in to an iOS application. Before you begin, we strongly recommend you read the calling setup guide.Generate Token
To start the call you need callToken and sessionID. SessionID is something you can define to identify your call, it can be a random string or any thing that is defined by the user. For that SessionID you need to generate callToken using Calls SDK. Generate token method takes two parameterauthToken and sessionId.
authToken: User can get the auth token from CometChatSDK that has a static method getUsersAuthToken().
sessionId: Any random string.
- Swift
Call Settings
Next you have to create your own CallSettingsBuilder by defining the properties you need in that call.
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:
- UIView i.e a view in which user want to show the calling view inside it.
- Video Settings.
- Swift
Start Call Session
To start a call, user have to passcallToken, 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
- Swift
End Call Session
To release the acquired calling resource and end the call, the end call session must be called.For Default Call
You only need to call the end call method of the chat SDK for default calling flows. Direct calling flows do not require it.
CometChat.endCall() method, which belongs to the CometChat Chat SDK, and the CometChatCalls.endSession() method, which belongs to the CometChat Calls SDK.
The user who pressed the end call button will call the CometChat.endCall() method, and the another user how was on call will call the two methods which is CometChat.clearActiveCall() and CometChatCalls.endSession() methods to release the calling resources

- Swift
- Swift
For Direct Call
- Swift
- Swift
MultiListener For Call Events
Through Multi Listener you can get Inn-call events in any class that acceptsCallsEventsDelegate
Add listener for a calls
- Swift
- Swift
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:Switch Camera
User can end the call by using theCometChatCalls.switchCamera()
- Swift
- Objective C
Audio Muted
User can end the call by using theaudioMuted(true)
- Swift
- Objective C
audioMuted(false)
- Swift
- Objective C
videoPaused(true)
- Swift
- Objective C
Unpause Video
User can end the call by using thevideoPaused(false)
- Swift
- Objective C
setAudioMode(mode: "**_**MODE**_**")
- Swift
- Objective C
- Swift
- Objective C
Enter PIP Mode
User can end the call by using theenterPIPMode()
- Swift
- Objective C
Exit PIP Mode
User can end the call by using theexitPIPMode()
- Swift
- Objective C
SwitchToVideoCall
User can end the call by using theswitchToVideoCall()
- Swift
- Objective C
Strat Recording
User can end the call by using thestartRecording()
- Swift
- Objective C
Stop Recording
User can end the call by using thestopRecording()
- Swift
- Objective C