Implement incoming and outgoing call notifications by integrating the Calls SDK with the CometChat Chat SDK for call signaling.
The Calls SDK handles the actual call session. For call signaling (ringing, accept, reject), use the CometChat Chat SDK’s calling features.
Overview
Call flow with ringing:
- Initiator sends a call request via Chat SDK
- Receiver gets notified of incoming call
- Receiver accepts or rejects the call
- Both parties join the call session using Calls SDK
Prerequisites
Install both SDKs:
Initialize Both SDKs
Initiate a Call
Start an outgoing call:
By default, an unanswered call automatically cancels after 45 seconds. You can customize this duration by passing an optional timeout parameter (in seconds) as the second argument to initiateCall().
Listen for Incoming Calls
Register a call listener to receive incoming calls:
Accept an Incoming Call
Reject an Incoming Call
Cancel an Outgoing Call
Start the Call Session
Once the call is accepted, join the session using the Calls SDK:
End the Call
Incoming Call UI Example
Outgoing Call UI Example
Cleanup
Remove the call listener when no longer needed: