Skip to main content
Quick Reference - Generate token and start a call session:

Overview

This section demonstrates how to start a call session in a React Native application. Previously known as Direct Calling.
Available via: SDK | UI Kits
Before you begin, we strongly recommend you read the calling setup guide.
If you want to implement a complete calling experience with ringing functionality (incoming/outgoing call UI), follow the Ringing guide first. Once the call is accepted, return here to start the call session.

Generate Call Token

A call token is required for secure access to a call session. Each token is unique to a specific session and user combination, ensuring that only authorized users can join the call. Use the generateToken() method to create a call token:

Start Call Session

Use the CometChatCalls.Component to render the call UI. This component requires a call token and a CallSettings object.

Call Settings

Configure the call experience using the following CallSettingsBuilder methods:

Call Listeners

The OngoingCallListener provides real-time callbacks for call session events. You can register listeners in two ways:
  1. Via CallSettingsBuilder: Use .setCallEventListener(listener) when building call settings
  2. Via addCallEventListener: Use CometChatCalls.addCallEventListener(listenerId, listener) to add multiple listeners
Always remove call event listeners when the component unmounts using CometChatCalls.removeCallEventListener(listenerId).

Events

End Call Session

Ringing Flow

When using the Ringing flow, you must coordinate between the CometChat Chat SDK and the Calls SDK.
User who initiates the end call:
Remote participant (receives the onCallEnded() callback):

Session Only Flow

When using the Session Only flow (direct call without ringing), call CometChatCalls.endSession() in the onCallEndButtonPressed() callback.

Methods

These methods are available for performing custom actions during an active call session.
These methods can only be called when a call session is active.

Switch Camera

Mute Audio

Pause Video

Set Audio Mode

Switch To Video Call

Get Audio Output Modes

End Call

  • Generate call tokens just before use — they are session-specific and time-limited
  • Always handle call end in both flows: Ringing requires both CometChat.endCall() and CometChatCalls.endSession()
  • Clean up listeners on component unmount to prevent memory leaks
  • Wrap the call component in a full-screen container with height: '100%', width: '100%', and position: 'relative'
  • Use unique listener IDs per component instance
  • Call token generation fails: Ensure the user is logged in and the auth token is valid
  • Call UI does not render: Verify the CometChatCalls.Component is wrapped in a View with explicit dimensions
  • Listeners not firing: Check that the listener is registered before the call session starts
  • onCallEnded not triggered in group calls: The callback only fires for 1:1 calls (exactly 2 participants)
  • Audio or video not working: Check device permissions for camera and microphone

Next Steps

Ringing

Implement a complete calling experience with incoming and outgoing call UI

Recording

Record call sessions for playback and compliance

Video View Customisation

Customize the main video container and participant tiles

Presenter Mode

Enable screen sharing and presenter layouts in calls