Overview
The CometChat Calls SDK provides two ways to join a session:Both approaches require a container view in your layout and properly configured SessionSettings.
Container Setup
Add a container view to your layout where the call interface will be rendered:Join with Session ID
The simplest way to join a session. Pass a session ID and the SDK automatically generates the token and joins the call.- Kotlin
- Java
All participants joining the same call must use the same session ID.
Join with Token
For scenarios requiring more control over token generation, such as pre-generating tokens, implementing custom caching strategies, or managing token lifecycle separately. Step 1: Generate Token Generate a call token for the session. Each token is unique to a specific session and user combination.- Kotlin
- Java
Step 2: Join with Token
Use the generated token to join the session. This gives you control over when and how the token is used.
- Kotlin
- Java
Complete Example
- Kotlin
- Java