Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions calls/android/recording.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
<Tabs>
<Tab title="Kotlin">
```kotlin
val callSession = CallSession.getInstance()

Check warning on line 21 in calls/android/recording.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/android/recording.mdx#L21

Did you really mean 'callSession'?
callSession.startRecording()
```
</Tab>
<Tab title="Java">
```java
CallSession callSession = CallSession.getInstance();

Check warning on line 27 in calls/android/recording.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/android/recording.mdx#L27

'callSession' is repeated!

Check warning on line 27 in calls/android/recording.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/android/recording.mdx#L27

Did you really mean 'callSession'?
callSession.startRecording();
```
</Tab>
Expand All @@ -39,13 +39,13 @@
<Tabs>
<Tab title="Kotlin">
```kotlin
val callSession = CallSession.getInstance()

Check warning on line 42 in calls/android/recording.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/android/recording.mdx#L42

Did you really mean 'callSession'?
callSession.stopRecording()
```
</Tab>
<Tab title="Java">
```java
CallSession callSession = CallSession.getInstance();

Check warning on line 48 in calls/android/recording.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/android/recording.mdx#L48

'callSession' is repeated!

Check warning on line 48 in calls/android/recording.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/android/recording.mdx#L48

Did you really mean 'callSession'?
callSession.stopRecording();
```
</Tab>
Expand All @@ -58,20 +58,27 @@
<Tabs>
<Tab title="Kotlin">
```kotlin
val sessionSettings = CometChatCalls.SessionSettingsBuilder()

Check warning on line 61 in calls/android/recording.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/android/recording.mdx#L61

Did you really mean 'sessionSettings'?
.enableAutoStartRecording(true)
.build()
```
</Tab>
<Tab title="Java">
```java
SessionSettings sessionSettings = new CometChatCalls.SessionSettingsBuilder()

Check warning on line 68 in calls/android/recording.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/android/recording.mdx#L68

'sessionSettings' is repeated!

Check warning on line 68 in calls/android/recording.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/android/recording.mdx#L68

Did you really mean 'sessionSettings'?
.enableAutoStartRecording(true)
.build();
```
</Tab>
</Tabs>

<Note>
**A recording runs until it is stopped.** Whether it was started manually or automatically through `enableAutoStartRecording`, it keeps running until someone stops it. If nobody does, it stops on its own when either:

- Everyone leaves the session β€” the recording ends about a minute later.
- Everyone in the session stays muted for 10 minutes.
</Note>

## Hide Recording Button

Hide the recording button from the default call UI:
Expand All @@ -79,14 +86,14 @@
<Tabs>
<Tab title="Kotlin">
```kotlin
val sessionSettings = CometChatCalls.SessionSettingsBuilder()

Check warning on line 89 in calls/android/recording.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/android/recording.mdx#L89

Did you really mean 'sessionSettings'?
.hideRecordingButton(true)
.build()
```
</Tab>
<Tab title="Java">
```java
SessionSettings sessionSettings = new CometChatCalls.SessionSettingsBuilder()

Check warning on line 96 in calls/android/recording.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/android/recording.mdx#L96

'sessionSettings' is repeated!

Check warning on line 96 in calls/android/recording.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/android/recording.mdx#L96

Did you really mean 'sessionSettings'?
.hideRecordingButton(true)
.build();
```
Expand All @@ -100,7 +107,7 @@
<Tabs>
<Tab title="Kotlin">
```kotlin
val callSession = CallSession.getInstance()

Check warning on line 110 in calls/android/recording.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/android/recording.mdx#L110

Did you really mean 'callSession'?

callSession.addMediaEventsListener(this, object : MediaEventsListener() {
override fun onRecordingStarted() {
Expand Down
7 changes: 7 additions & 0 deletions calls/flutter/recording.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ SessionSettings sessionSettings = CometChatCalls.SessionSettingsBuilder()
.build();
```

<Note>
**A recording runs until it is stopped.** Whether it was started manually or automatically through `enableAutoStartRecording`, it keeps running until someone stops it. If nobody does, it stops on its own when either:

- Everyone leaves the session β€” the recording ends about a minute later.
- Everyone in the session stays muted for 10 minutes.
</Note>

## Hide Recording Button

Hide the recording button from the default call UI:
Expand Down
7 changes: 7 additions & 0 deletions calls/ios/recording.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</Tab>
<Tab title="Objective-C">
```objectivec
[[CallSession shared] startRecording];

Check warning on line 26 in calls/ios/recording.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/ios/recording.mdx#L26

Did you really mean 'startRecording'?
```
</Tab>
</Tabs>
Expand All @@ -42,7 +42,7 @@
</Tab>
<Tab title="Objective-C">
```objectivec
[[CallSession shared] stopRecording];

Check warning on line 45 in calls/ios/recording.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/ios/recording.mdx#L45

Did you really mean 'stopRecording'?
```
</Tab>
</Tabs>
Expand All @@ -54,7 +54,7 @@
<Tabs>
<Tab title="Swift">
```swift
let sessionSettings = CometChatCalls.sessionSettingsBuilder

Check warning on line 57 in calls/ios/recording.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/ios/recording.mdx#L57

Did you really mean 'sessionSettings'?
.enableAutoStartRecording(true)
.build()
```
Expand All @@ -68,6 +68,13 @@
</Tab>
</Tabs>

<Note>
**A recording runs until it is stopped.** Whether it was started manually or automatically through `enableAutoStartRecording`, it keeps running until someone stops it. If nobody does, it stops on its own when either:

- Everyone leaves the session β€” the recording ends about a minute later.
- Everyone in the session stays muted for 10 minutes.
</Note>

## Hide Recording Button

Hide the recording button from the default call UI:
Expand All @@ -75,7 +82,7 @@
<Tabs>
<Tab title="Swift">
```swift
let sessionSettings = CometChatCalls.sessionSettingsBuilder

Check warning on line 85 in calls/ios/recording.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/ios/recording.mdx#L85

Did you really mean 'sessionSettings'?
.hideRecordingButton(true)
.build()
```
Expand Down
4 changes: 4 additions & 0 deletions calls/javascript/actions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
CometChatCalls.muteAudio();
```

### Unmute Audio

Check warning on line 20 in calls/javascript/actions.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/javascript/actions.mdx#L20

Did you really mean 'Unmute'?

Unmutes your local microphone, resuming audio transmission.

Check warning on line 22 in calls/javascript/actions.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/javascript/actions.mdx#L22

Did you really mean 'Unmutes'?

```javascript
CometChatCalls.unmuteAudio();
Expand Down Expand Up @@ -184,6 +184,10 @@
CometChatCalls.leaveSession();
```

<Note>
`leaveSession()` takes no session ID. `CometChatCalls` is a singleton that tracks one active session at a time, so this leaves whichever session is currently in progress. The same applies to every action on this page. See [Single Active Session](/calls/javascript/overview#single-active-session).
</Note>

## UI Controls

### Show Settings Dialog
Expand Down
15 changes: 15 additions & 0 deletions calls/javascript/join-session.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
|-----------|------|-------------|
| `callToken` | String | Previously generated call token |
| `callSettings` | Object | Configuration for the session (see [Session Settings](/calls/javascript/session-settings)) |
| `container` | HTMLElement | Container element for the call UI |

Check warning on line 90 in calls/javascript/join-session.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/javascript/join-session.mdx#L90

Did you really mean 'HTMLElement'?

The method returns an object with:

Expand Down Expand Up @@ -135,6 +135,21 @@
All participants joining the same call must use the same session ID.
</Note>

## One Session at a Time

`CometChatCalls` is a singleton that holds a single active session. Joining a second session while one is in progress is not supported - leave the current session first, wait for `onSessionLeft`, then join the next one.

```javascript
CometChatCalls.addEventListener("onSessionLeft", async () => {
const { token } = await CometChatCalls.generateToken(nextSessionId);
await CometChatCalls.joinSession(token, callSettings, container);
});

CometChatCalls.leaveSession();
```

This is also why `leaveSession()` and the other [actions](/calls/javascript/actions) take no session ID - they always apply to the session that is currently active. See [Single Active Session](/calls/javascript/overview#single-active-session) for the full behavior.

## Error Handling

Common errors when joining a session:
Expand Down
32 changes: 32 additions & 0 deletions calls/javascript/migration-guide-v5.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
- **Granular event listeners** β€” subscribe to specific events like `onParticipantJoined` or `onSessionLeft` instead of one monolithic `OngoingCallListener`
- **Dedicated `login()` method** β€” the Calls SDK now handles its own authentication instead of depending on the Chat SDK's auth token or REST APIs
- **Simplified initialization** β€” pass plain objects to `init()` and `joinSession()` instead of using builder classes
- **Strongly-typed enums** β€” `LayoutType`, `SessionType` instead of raw strings

Check warning on line 29 in calls/javascript/migration-guide-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/javascript/migration-guide-v5.mdx#L29

Did you really mean 'enums'?

---

Expand Down Expand Up @@ -79,9 +79,9 @@
<Tab title="v4">
```javascript
// No dedicated Calls SDK login β€” relied on Chat SDK for auth token
const authToken = CometChat.getUserAuthToken();

Check warning on line 82 in calls/javascript/migration-guide-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/javascript/migration-guide-v5.mdx#L82

Did you really mean 'authToken'?

// Had to pass authToken manually

Check warning on line 84 in calls/javascript/migration-guide-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/javascript/migration-guide-v5.mdx#L84

Did you really mean 'authToken'?
CometChatCalls.generateToken(sessionId, authToken).then(
(token) => { /* use token to start session */ },
(error) => { }
Expand Down Expand Up @@ -118,7 +118,7 @@
<Tabs>
<Tab title="v4">
```javascript
const callSettings = new CometChatCalls.CallSettingsBuilder()

Check warning on line 121 in calls/javascript/migration-guide-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/javascript/migration-guide-v5.mdx#L121

Did you really mean 'callSettings'?
.enableDefaultLayout(true)
.setIsAudioOnlyCall(true)
.showEndCallButton(true)
Expand All @@ -135,15 +135,15 @@
onCallEndButtonPressed: () => { },
onUserJoined: (user) => { },
onUserLeft: (user) => { },
onUserListUpdated: (userList) => { },

Check warning on line 138 in calls/javascript/migration-guide-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/javascript/migration-guide-v5.mdx#L138

Did you really mean 'userList'?
onError: (error) => { },

Check warning on line 139 in calls/javascript/migration-guide-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/javascript/migration-guide-v5.mdx#L139

Did you really mean 'onError'?
}))
.build();
```
</Tab>
<Tab title="v5">
```javascript
const sessionSettings = {

Check warning on line 146 in calls/javascript/migration-guide-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/javascript/migration-guide-v5.mdx#L146

Did you really mean 'sessionSettings'?
sessionType: "VIDEO", // or "VOICE"
layout: "TILE", // or "SPOTLIGHT", "SIDEBAR"
startAudioMuted: false,
Expand Down Expand Up @@ -209,6 +209,20 @@

Static methods remain on `CometChatCalls` but some have been renamed.

<Note>
**Boolean toggles are now paired methods.** In v4, `muteAudio()` took a boolean: `muteAudio(true)` muted the mic and `muteAudio(false)` unmuted it. In v5 these are two separate, argument-free methods β€” replace `muteAudio(true)` with `muteAudio()` and `muteAudio(false)` with `unmuteAudio()`. The same split applies to `pauseVideo(true)` / `pauseVideo(false)`, which become `pauseVideo()` and `resumeVideo()`.

Check warning on line 213 in calls/javascript/migration-guide-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/javascript/migration-guide-v5.mdx#L213

Did you really mean 'unmuted'?
</Note>

```javascript
// v4
CometChatCalls.muteAudio(true); // mute
CometChatCalls.muteAudio(false); // unmute

// v5
CometChatCalls.muteAudio(); // mute
CometChatCalls.unmuteAudio(); // unmute
```

| v4 Method | v5 Method |
|---|---|
| `CometChatCalls.endSession()` | `CometChatCalls.leaveSession()` |
Expand Down Expand Up @@ -289,6 +303,24 @@
`addEventListener()` returns an unsubscribe function. Call it to remove the listener. You can also pass an `AbortSignal` for cleanup.
</Note>

### New Events Require `addEventListener()`

The events introduced in v5 are only delivered through `addEventListener()`. None of the v4 registration paths β€” `setCallListener()` / `setCallEventListener()` on `CallSettingsBuilder` and `CometChatCalls.addCallEventListener(name, listener)` β€” will ever fire them, because `OngoingCallListener` only carries the legacy v4 event set. Events such as `onSessionJoined`, `onConnectionLost`, `onLeaveSessionButtonClicked`, and `onCallLayoutChanged` are unreachable from a v4 listener no matter how it is registered.

You don't have to migrate everything at once. `addEventListener()` works alongside an existing v4 listener without breaking it β€” keep your current `OngoingCallListener` for the legacy events and add `addEventListener()` subscriptions for the new ones.

```javascript
// Existing v4 listener keeps working
CometChatCalls.addCallEventListener("MY_LISTENER", new CometChatCalls.OngoingCallListener({
onCallEnded: () => { },
onUserJoined: (user) => { },
}));

// Add v5-only events alongside it
CometChatCalls.addEventListener("onConnectionLost", () => { });
CometChatCalls.addEventListener("onCallLayoutChanged", (layoutType) => { });
```

### Event Mapping

| v4 Event | v5 Event |
Expand Down
34 changes: 34 additions & 0 deletions calls/javascript/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
| Samsung Internet | βœ… Full support |

<Note>
For native mobile apps, consider using the [iOS](/calls/ios/overview) or [Android](/calls/android/overview) SDKs for better performance and native features like CallKit/VoIP.

Check warning on line 48 in calls/javascript/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/javascript/overview.mdx#L48

Did you really mean 'SDKs'?
</Note>

## Framework Integrations
Expand All @@ -59,7 +59,7 @@
</Card>

<Card title="Vue" icon="vuejs" href="/calls/javascript/vue-integration">
Composables and reactive state management

Check warning on line 62 in calls/javascript/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/javascript/overview.mdx#L62

Did you really mean 'Composables'?
</Card>

<Card title="Angular" icon="angular" href="/calls/javascript/angular-integration">
Expand Down Expand Up @@ -142,6 +142,40 @@
| `CallSettings` | Configuration object for individual call sessions |
| `addEventListener` | Method to register event listeners for session, participant, media, and UI events |

## Single Active Session

`CometChatCalls` is a singleton, and it tracks one active call session at a time. Every session method acts on that current session, which is why methods like `leaveSession()` take no session ID:

```javascript
// Joins and becomes the active session
await CometChatCalls.joinSession(callToken, callSettings, container);

// Acts on whatever session is currently active - no session ID needed
CometChatCalls.leaveSession();
```

| Behavior | Detail |
|----------|--------|
| One session at a time | The SDK does not support being connected to two sessions simultaneously. Leave the current session before joining another. |
| Session methods take no session ID | `leaveSession()` and the other [actions](/calls/javascript/actions) apply to the active session only. |
| Actions apply to the active session | `muteAudio()`, `pauseVideo()`, `startScreenShare()`, and similar methods target the session currently in progress. |
| Events are not session-scoped | Listeners registered with `addEventListener` fire for the active session. |

To move a user from one call to another, leave the current session, wait for the `onSessionLeft` event, then generate a token for the new session and join:

```javascript
CometChatCalls.addEventListener("onSessionLeft", async () => {
const { token } = await CometChatCalls.generateToken(nextSessionId);
await CometChatCalls.joinSession(token, callSettings, container);
});

CometChatCalls.leaveSession();
```

<Note>
The limit applies per SDK instance. Separate browser tabs or windows each load their own instance, so they can hold separate sessions independently.
</Note>

## Sample App

<CardGroup cols={3}>
Expand Down
7 changes: 7 additions & 0 deletions calls/javascript/recording.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ Stop the current recording:
CometChatCalls.stopRecording();
```

<Note>
**A recording runs until it is stopped.** Whether it was started manually or automatically through `autoStartRecording`, it keeps running until someone stops it. If nobody does, it stops on its own when either:

- Everyone leaves the session β€” the recording ends about a minute later.
- Everyone in the session stays muted for 10 minutes.
</Note>

## Recording Events

### Recording Started
Expand Down
4 changes: 4 additions & 0 deletions calls/react-native/actions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
CometChatCalls.muteAudio();
```

### Unmute Audio

Check warning on line 20 in calls/react-native/actions.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/react-native/actions.mdx#L20

Did you really mean 'Unmute'?

Unmute the local user's microphone:

Check warning on line 22 in calls/react-native/actions.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/react-native/actions.mdx#L22

Did you really mean 'Unmute'?

```tsx
CometChatCalls.unmuteAudio();
Expand Down Expand Up @@ -65,6 +65,10 @@
The `leaveSession()` method ends the call for the local user. Other participants will remain in the call unless they also leave.
</Note>

<Note>
`leaveSession()` takes no session ID. `CometChatCalls` is a singleton that tracks one active session at a time, so this leaves whichever session is currently in progress. The same applies to every action on this page. See [Single Active Session](/calls/react-native/overview#single-active-session).
</Note>

## Raise Hand

### Raise Hand
Expand Down
15 changes: 15 additions & 0 deletions calls/react-native/join-session.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,21 @@ const styles = StyleSheet.create({
export default CallScreen;
```

## One Session at a Time

`CometChatCalls` is a singleton that holds a single active session. Render one `CometChatCalls.Component` at a time - joining a second session while one is in progress is not supported. Leave the current session first, wait for `onSessionLeft`, then join the next one.

```tsx
CometChatCalls.addEventListener('onSessionLeft', async () => {
const { token } = await CometChatCalls.generateToken(nextSessionId);
setCallToken(token); // Re-renders the component with the new session
}, { signal });

CometChatCalls.leaveSession();
```

This is also why `leaveSession()` and the other [actions](/calls/react-native/actions) take no session ID - they always apply to the session that is currently active. See [Single Active Session](/calls/react-native/overview#single-active-session) for the full behavior.

## Error Handling

Common errors when joining a session:
Expand Down
32 changes: 32 additions & 0 deletions calls/react-native/migration-guide-v5.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
- **Granular event listeners** β€” subscribe to specific events like `onParticipantJoined` or `onSessionLeft` instead of one monolithic `OngoingCallListener`
- **Dedicated `login()` method** β€” the Calls SDK now handles its own authentication instead of depending on the Chat SDK's auth token or REST APIs
- **Simplified initialization** β€” pass plain objects to `init()` instead of using builder classes
- **Strongly-typed enums** β€” `LayoutType`, `SessionType` instead of raw strings

Check warning on line 29 in calls/react-native/migration-guide-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/react-native/migration-guide-v5.mdx#L29

Did you really mean 'enums'?

---

Expand Down Expand Up @@ -79,9 +79,9 @@
<Tab title="v4">
```javascript
// No dedicated Calls SDK login β€” relied on Chat SDK for auth token
const authToken = CometChat.getUserAuthToken();

Check warning on line 82 in calls/react-native/migration-guide-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/react-native/migration-guide-v5.mdx#L82

Did you really mean 'authToken'?

// Had to pass authToken manually

Check warning on line 84 in calls/react-native/migration-guide-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/react-native/migration-guide-v5.mdx#L84

Did you really mean 'authToken'?
CometChatCalls.generateToken(sessionId, authToken).then(
(token) => { /* use token to start session */ },
(error) => { }
Expand Down Expand Up @@ -120,7 +120,7 @@
<Tabs>
<Tab title="v4">
```javascript
const callSettings = new CometChatCalls.CallSettingsBuilder()

Check warning on line 123 in calls/react-native/migration-guide-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/react-native/migration-guide-v5.mdx#L123

Did you really mean 'callSettings'?
.enableDefaultLayout(true)
.setIsAudioOnlyCall(true)
.showEndCallButton(true)
Expand All @@ -135,15 +135,15 @@
onCallEndButtonPressed: () => { },
onUserJoined: (user) => { },
onUserLeft: (user) => { },
onUserListUpdated: (userList) => { },

Check warning on line 138 in calls/react-native/migration-guide-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/react-native/migration-guide-v5.mdx#L138

Did you really mean 'userList'?
onError: (error) => { },

Check warning on line 139 in calls/react-native/migration-guide-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/react-native/migration-guide-v5.mdx#L139

Did you really mean 'onError'?
}))
.build();
```
</Tab>
<Tab title="v5">
```javascript
const sessionSettings = {

Check warning on line 146 in calls/react-native/migration-guide-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/react-native/migration-guide-v5.mdx#L146

Did you really mean 'sessionSettings'?
sessionType: "VIDEO", // or "VOICE"
layout: "TILE", // or "SIDEBAR" or "SPOTLIGHT"
startAudioMuted: false,
Expand Down Expand Up @@ -212,6 +212,20 @@

Static methods remain on `CometChatCalls` but some have been renamed.

<Note>
**Boolean toggles are now paired methods.** In v4, `muteAudio()` took a boolean: `muteAudio(true)` muted the mic and `muteAudio(false)` unmuted it. In v5 these are two separate, argument-free methods β€” replace `muteAudio(true)` with `muteAudio()` and `muteAudio(false)` with `unmuteAudio()`. The same split applies to `pauseVideo(true)` / `pauseVideo(false)`, which become `pauseVideo()` and `resumeVideo()`.
</Note>

```javascript
// v4
CometChatCalls.muteAudio(true); // mute
CometChatCalls.muteAudio(false); // unmute

// v5
CometChatCalls.muteAudio(); // mute
CometChatCalls.unmuteAudio(); // unmute
```

| v4 Method | v5 Method |
|---|---|
| `CometChatCalls.endSession()` | `CometChatCalls.leaveSession()` |
Expand Down Expand Up @@ -290,6 +304,24 @@
`addEventListener()` returns an unsubscribe function. Call it to remove the listener.
</Note>

### New Events Require `addEventListener()`

The events introduced in v5 are only delivered through `addEventListener()`. Neither of the v4 registration paths β€” `setCallEventListener()` on `CallSettingsBuilder` and `CometChatCalls.addCallEventListener(name, listener)` β€” will ever fire them, because `OngoingCallListener` only carries the legacy v4 event set. Events such as `onSessionJoined`, `onConnectionLost`, `onLeaveSessionButtonClicked`, and `onCallLayoutChanged` are unreachable from a v4 listener no matter how it is registered.

You don't have to migrate everything at once. `addEventListener()` works alongside an existing v4 listener without breaking it β€” keep your current `OngoingCallListener` for the legacy events and add `addEventListener()` subscriptions for the new ones.

```javascript
// Existing v4 listener keeps working
CometChatCalls.addCallEventListener("MY_LISTENER", new CometChatCalls.OngoingCallListener({
onCallEnded: () => { },
onUserJoined: (user) => { },
}));

// Add v5-only events alongside it
CometChatCalls.addEventListener("onConnectionLost", () => { });
CometChatCalls.addEventListener("onCallLayoutChanged", (layoutType) => { });
```

### Event Mapping

| v4 Event | v5 Event |
Expand Down
30 changes: 29 additions & 1 deletion calls/react-native/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
1. **CometChat Account**: [Sign up](https://app.cometchat.com/signup) and create an app to get your App ID, Region, and API Key
2. **CometChat Users**: Users must exist in CometChat to use calling features. For testing, create users via the [Dashboard](https://app.cometchat.com) or [REST API](/rest-api/users/create). Authentication is handled by the Calls SDK - see [Authentication](/calls/react-native/authentication)
3. **React Native Requirements**:
- React Native 0.71 or later
- React Native 0.71 or later (works with both the old architecture and the [New Architecture](/calls/react-native/setup#react-native-new-architecture), including bridgeless mode)

Check warning on line 17 in calls/react-native/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/react-native/overview.mdx#L17

Did you really mean 'bridgeless'?
- Node.js 18 or later
- iOS: Minimum iOS 13.0, Xcode 14.0+

Check warning on line 19 in calls/react-native/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/react-native/overview.mdx#L19

Did you really mean 'Xcode'?
- Android: Minimum SDK API Level 24 (Android 7.0)
4. **Permissions**: Camera and microphone permissions for video/audio calls

Expand Down Expand Up @@ -95,6 +95,34 @@
| `CometChatCalls.Component` | React component that renders the call UI |
| `CometChatCalls.addEventListener` | Subscribe to call events; returns an unsubscribe function |

## Single Active Session

`CometChatCalls` is a singleton, and it tracks one active call session at a time. Every session method acts on that current session, which is why methods like `leaveSession()` take no session ID:

```tsx
// Acts on whatever session is currently active - no session ID needed
CometChatCalls.leaveSession();
```

| Behavior | Detail |
|----------|--------|
| One session at a time | The SDK does not support being connected to two sessions simultaneously. Leave the current session before joining another. |
| One `Component` at a time | Render a single `CometChatCalls.Component` for the active call. Mounting two at once is not supported. |
| Session methods take no session ID | `leaveSession()` and the other [actions](/calls/react-native/actions) apply to the active session only. |
| Actions apply to the active session | `muteAudio()`, `pauseVideo()`, `switchCamera()`, and similar methods target the session currently in progress. |
| Events are not session-scoped | Listeners registered with `addEventListener` fire for the active session. |

To move a user from one call to another, leave the current session, wait for the `onSessionLeft` event, then generate a token for the new session and render the component with the new token:

```tsx
CometChatCalls.addEventListener('onSessionLeft', async () => {
const { token } = await CometChatCalls.generateToken(nextSessionId);
setCallToken(token); // Re-renders CometChatCalls.Component with the new session
}, { signal });

CometChatCalls.leaveSession();
```

## Related Documentation

- [Setup](/calls/react-native/setup) - Install and configure the SDK
Expand Down
7 changes: 7 additions & 0 deletions calls/react-native/recording.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ Stop an active recording:
CometChatCalls.stopRecording();
```

<Note>
**A recording runs until it is stopped.** Whether it was started manually or automatically through `autoStartRecording`, it keeps running until someone stops it. If nobody does, it stops on its own when either:

- Everyone leaves the session β€” the recording ends about a minute later.
- Everyone in the session stays muted for 10 minutes.
</Note>

## Recording Events

Listen for recording state changes:
Expand Down
8 changes: 8 additions & 0 deletions calls/react-native/setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@
yarn add @react-native-async-storage/async-storage@^2.1.2 react-native-background-timer@^2.4.1 react-native-performance@^5.1.2 react-native-svg@^15.12.0 react-native-url-polyfill@2.0.0 react-native-webrtc@124.0.7
```

## React Native New Architecture

The Calls SDK works with both the old architecture and the New Architecture, including bridgeless mode. No extra setup is needed β€” leave `newArchEnabled` set to whatever your app requires and follow the same integration steps either way.

Check warning on line 64 in calls/react-native/setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/react-native/setup.mdx#L64

Did you really mean 'bridgeless'?

<Note>
The SDK ships as a legacy native module rather than a TurboModule/Fabric component. On the New Architecture it runs through React Native's built-in interop layer, so the API and behavior are identical on both architectures.

Check warning on line 67 in calls/react-native/setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/react-native/setup.mdx#L67

Did you really mean 'interop'?
</Note>

## iOS Configuration

### Install CocoaPods Dependencies
Expand Down Expand Up @@ -86,7 +94,7 @@

For calls to continue when the app is in the background:

1. Open your project in Xcode

Check warning on line 97 in calls/react-native/setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/react-native/setup.mdx#L97

Did you really mean 'Xcode'?
2. Select your target and go to **Signing & Capabilities**
3. Click **+ Capability** and add **Background Modes**
4. Enable:
Expand Down
10 changes: 9 additions & 1 deletion calls/v4/android/call-logs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,17 @@
title: "Call Logs"
sidebarTitle: "Call Logs"
sdk_version: "4.x"
description: "CometChat Calling SDK v4 - Stable Release - Call Logs for Android"
description: "CometChat Calling SDK v4 - Legacy Release - Call Logs for Android"
---

<Warning>
**You're reading the legacy documentation for Calling SDK v4 (Android).**

Follow this page only if your app is on **v4.x**. If you're using v5, see the [**Calling SDK v5 documentation**](/calls/android/overview) instead.

Ready to move off v4? Follow the [v4 β†’ v5 migration guide](/calls/android/migration-guide-v5).
</Warning>

## Overview

CometChat's Android Call SDK provides a comprehensive way to integrate call logs into your application, enhancing your user experience by allowing users to effortlessly keep track of their communication history. Call logs provide crucial information such as call duration, participants, and more.
Expand Down Expand Up @@ -32,12 +40,12 @@
| `setLimit(int limit)` | Specifies the number of call logs to fetch. |
| `setCallType(@CometChatCallsConstants.CallType String callType)` | Sets the type of calls to fetch (audio or video). It accepts `CallType` Enum with following values `CometChatCallsConstants.CallType.CALL_TYPE_VIDEO`, `CometChatCallsConstants.CallType.CALL_TYPE_AUDIO` & `CometChatCallsConstants.CallType.CALL_TYPE_AUDIO_VIDEO` |
| `setCallStatus(@CometChatCallsConstants.CallStatus String callStatus)` | Sets the status of calls to fetch (initiated, ongoing, etc.). It accepts `CallStatus` Enum with following values `CometChatCallsConstants.CallStatus.CALL_STATUS_ONGOING`, `CometChatCallsConstants.CallStatus.CALL_STATUS_BUSY`, `CometChatCallsConstants.CallStatus.CALL_STATUS_REJECTED`, `CometChatCallsConstants.CallStatus.CALL_STATUS_CANCELLED`, `CometChatCallsConstants.CallStatus.CALL_STATUS_ENDED`, `CometChatCallsConstants.CallStatus.CALL_STATUS_MISSED`, `CometChatCallsConstants.CallStatus.CALL_STATUS_INITIATED`, `CometChatCallsConstants.CallStatus.CALL_STATUS_UNANSWERED` |
| setHasRecording(boolean hasRecording) | Sets whether to fetch calls that have recordings. |

Check warning on line 43 in calls/v4/android/call-logs.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/v4/android/call-logs.mdx#L43

Did you really mean 'hasRecording'?
| setCallCategory(@CometChatCallsConstants.CallLogCategory String callCategory) | Sets the category of calls to fetch (call or meet). It accepts `CallLogCategory` Enum with following values `CometChatCallsConstants.CallLogCategory.CALL_CATEGORY_CALL` & `CometChatCallsConstants.CallLogCategory.CALL_CATEGORY_MEET` |

Check warning on line 44 in calls/v4/android/call-logs.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/v4/android/call-logs.mdx#L44

Did you really mean 'callCategory'?
| setCallDirection(@CometChatCallsConstants.CallDirection String callDirection) | Sets the direction of calls to fetch. It accepts `CallDirection` Enum with following values `CometChatCallsConstants.CallDirection.CALL_DIRECTION_INCOMING` & `CometChatCallsConstants.CallDirection.CALL_DIRECTION_OUTGOING` |

Check warning on line 45 in calls/v4/android/call-logs.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/v4/android/call-logs.mdx#L45

Did you really mean 'callDirection'?
| setUid(String uid) | Sets the UID of the user whose call logs to fetch. |

Check warning on line 46 in calls/v4/android/call-logs.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/v4/android/call-logs.mdx#L46

Did you really mean 'uid'?
| setGuid(String guid) | Sets the GUID of the user whose call logs to fetch. |

Check warning on line 47 in calls/v4/android/call-logs.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/v4/android/call-logs.mdx#L47

Did you really mean 'guid'?
| setAuthToken(String authToken) | Sets the Auth token of the logged-in user. |

Check warning on line 48 in calls/v4/android/call-logs.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/v4/android/call-logs.mdx#L48

Did you really mean 'authToken'?

### Fetch Next

Expand Down
10 changes: 9 additions & 1 deletion calls/v4/android/call-session.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,17 @@
title: "Call Session"
sidebarTitle: "Call Session"
sdk_version: "4.x"
description: "CometChat Calling SDK v4 - Stable Release - Call Session for Android"
description: "CometChat Calling SDK v4 - Legacy Release - Call Session for Android"
---

<Warning>
**You're reading the legacy documentation for Calling SDK v4 (Android).**

Follow this page only if your app is on **v4.x**. If you're using v5, see the [**Calling SDK v5 documentation**](/calls/android/overview) instead.

Ready to move off v4? Follow the [v4 β†’ v5 migration guide](/calls/android/migration-guide-v5).
</Warning>

## Overview

This section demonstrates how to start a call session in an Android application. Previously known as **Direct Calling**.
Expand All @@ -28,7 +36,7 @@
<Tabs>
<Tab title="Java">
```java
String sessionId = "" //Random or available in call obecjt in case of default calling

Check warning on line 39 in calls/v4/android/call-session.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/v4/android/call-session.mdx#L39

Did you really mean 'sessionId'?

Check warning on line 39 in calls/v4/android/call-session.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/v4/android/call-session.mdx#L39

Did you really mean 'obecjt'?
String userAuthToken = CometChat.getUserAuthToken() //Logged in user auth token

CometChatCalls.generateToken(sessionId, userAuthToken, new CometChatCalls.CallbackListener<GenerateToken>() {
Expand Down Expand Up @@ -85,21 +93,21 @@
| ------------------ | ------------------------------------------------------------------------ |
| `activityContext` | The activity context where the call UI will be displayed |
| `videoContainer` | A `RelativeLayout` where the calling UI will be rendered |
| `callToken` | The `GenerateToken` object received from `generateToken()` onSuccess |

Check warning on line 96 in calls/v4/android/call-session.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/v4/android/call-session.mdx#L96

Did you really mean 'onSuccess'?

<Tabs>
<Tab title="Java">
```java
RelativeLayout videoContainer = findViewById(R.id.video_container);

Check warning on line 101 in calls/v4/android/call-session.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/v4/android/call-session.mdx#L101

Did you really mean 'videoContainer'?
Context activityContext = this;

Check warning on line 102 in calls/v4/android/call-session.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/v4/android/call-session.mdx#L102

Did you really mean 'activityContext'?
GenerateToken callToken; // Received from generateToken() onSuccess

Check warning on line 103 in calls/v4/android/call-session.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/v4/android/call-session.mdx#L103

Did you really mean 'callToken'?

CallSettings callSettings = new CometChatCalls.CallSettingsBuilder(activityContext, videoContainer)

Check warning on line 105 in calls/v4/android/call-session.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/v4/android/call-session.mdx#L105

Did you really mean 'callSettings'?

Check warning on line 105 in calls/v4/android/call-session.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/v4/android/call-session.mdx#L105

Did you really mean 'videoContainer'?
.setDefaultLayoutEnable(true)
.setIsAudioOnly(false)
.build();

CometChatCalls.startSession(callToken, callSettings, new CometChatCalls.CallbackListener<String>() {

Check warning on line 110 in calls/v4/android/call-session.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/v4/android/call-session.mdx#L110

Did you really mean 'callSettings'?
@Override
public void onSuccess(String s) {
// Call session started successfully
Expand Down Expand Up @@ -178,9 +186,9 @@
<Tabs>
<Tab title="Java">
```java
private String listenerId = "UNIQUE_LISTENER_ID";

Check warning on line 189 in calls/v4/android/call-session.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/v4/android/call-session.mdx#L189

Did you really mean 'listenerId'?

// Register listener (e.g., in onCreate or onResume)

Check warning on line 191 in calls/v4/android/call-session.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/v4/android/call-session.mdx#L191

Did you really mean 'onCreate'?

Check warning on line 191 in calls/v4/android/call-session.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/v4/android/call-session.mdx#L191

Did you really mean 'onResume'?
CometChatCalls.addCallsEventListeners(listenerId, new CometChatCallsEventsListener() {
@Override
public void onCallEnded() {
Expand Down Expand Up @@ -238,7 +246,7 @@
}
});

// Unregister listener (e.g., in onDestroy or onPause)

Check warning on line 249 in calls/v4/android/call-session.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/v4/android/call-session.mdx#L249

Did you really mean 'Unregister'?

Check warning on line 249 in calls/v4/android/call-session.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/v4/android/call-session.mdx#L249

Did you really mean 'onDestroy'?

Check warning on line 249 in calls/v4/android/call-session.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/v4/android/call-session.mdx#L249

Did you really mean 'onPause'?
CometChatCalls.removeCallsEventListeners(listenerId);
```

Expand Down Expand Up @@ -469,7 +477,7 @@
Controls the local audio stream transmission. When muted, other participants cannot hear the local user.

- `true` β€” Mutes the microphone, stops transmitting audio
- `false` β€” Unmutes the microphone, resumes audio transmission

Check warning on line 480 in calls/v4/android/call-session.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/v4/android/call-session.mdx#L480

Did you really mean 'Unmutes'?

<Tabs>
<Tab title="Java">
Expand Down Expand Up @@ -525,7 +533,7 @@
<Tabs>
<Tab title="Java">
```java
String audioMode = CometChatCallsConstants.AUDIO_MODE_EARPIECE;

Check warning on line 536 in calls/v4/android/call-session.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/v4/android/call-session.mdx#L536

Did you really mean 'audioMode'?
CometChatCalls.setAudioMode(audioMode);
```

Expand All @@ -533,7 +541,7 @@

<Tab title="Kotlin">
```kotlin
val audioMode = CometChatCallsConstants.AUDIO_MODE_EARPIECE

Check warning on line 544 in calls/v4/android/call-session.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

calls/v4/android/call-session.mdx#L544

Did you really mean 'audioMode'?
CometChatCalls.setAudioMode(audioMode)
```

Expand Down
12 changes: 8 additions & 4 deletions calls/v4/android/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@
title: "Calling SDK"
sidebarTitle: "Overview"
sdk_version: "4.x"
description: "CometChat Calling SDK v4 - Stable Release - Overview for Android. This is the stable v4 documentation. Most users should use this version."
description: "CometChat Calling SDK v4 - Legacy Release - Overview for Android. This is the legacy v4 documentation. Most users should use v5, the current stable version."
---

<Note>
πŸš€ **v5 Beta Available** β€” The Calling SDK v5 is now available in beta with significant improvements. [Check out the v5 docs β†’](/calls/android/overview)
</Note>
<Warning>
**You're reading the legacy documentation for Calling SDK v4 (Android).**

Follow this page only if your app is on **v4.x**. If you're using v5, see the [**Calling SDK v5 documentation**](/calls/android/overview) instead.

Ready to move off v4? Follow the [v4 β†’ v5 migration guide](/calls/android/migration-guide-v5).
</Warning>

## Overview

Expand Down
Loading