Skip to content
Merged
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
17 changes: 13 additions & 4 deletions calls/android/migrating-from-legacy-ringing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@
description: "Move an Android app from Chat SDK call signalling and Push Notifications SDK 1.0 VoIP to ringing with the Calls SDK 5.1 and the Push Notifications SDK 2.0: what to add, what to delete, and how each method maps."
---

Legacy ringing signalled calls through the Chat SDK: `CometChat.initiateCall` created the call, a `CallListener` on the WebSocket told the callee, `acceptCall` and `rejectCall` answered, and the app rang the device itself, often with a hand-built `ConnectionService`. Ringing now runs on the Calls SDK and the Push Notifications SDK calls module. The Chat SDK's calling methods are superseded by the Calls SDK and no longer used; a coming Chat SDK release marks them deprecated.

Check warning on line 8 in calls/android/migrating-from-legacy-ringing.mdx

View check run for this annotation

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

calls/android/migrating-from-legacy-ringing.mdx#L8

Did you really mean 'callee'?

This page is the diff. For the full description of the current flow see [Ringing](/calls/android/ringing); for the push side see [Push ringing](/calls/android/voip-calling).

## Before you start

Ringing with the Calls SDK is opt-in on the client: moving your app to the Calls SDK 5.1 and Push Notifications SDK 2.0 APIs below is the migration. While some of your users are still on legacy ringing, one dashboard setting lets the two flows call each other; see [While some users are still on legacy ringing](#while-some-users-are-still-on-legacy-ringing).
Ringing with the Calls SDK is opt-in on the client: moving your app to the Calls SDK 5.1 and Push Notifications SDK 2.0 APIs below is the migration. While some of your users are still on legacy ringing, one dashboard setting lets the two flows call each other; see [While some users are still on legacy ringing](#while-some-users-are-still-on-legacy-ringing). If you use the CometChat UI Kit, UI Kit 6.2.0 initialises the Calls SDK and logs the user into it for you; you add the Calls SDK and Push Notifications SDK artifacts as shown in [Calling Integration](/ui-kit/android/calling-integration).

## Why it changed

| Legacy | Now |
|--------|-----|
| Incoming calls arrived on the Chat WebSocket, so a killed or backgrounded app needed a separate push + Telecom integration to ring | One path: the push rings in every app state, with the app killed included |

Check warning on line 20 in calls/android/migrating-from-legacy-ringing.mdx

View check run for this annotation

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

calls/android/migrating-from-legacy-ringing.mdx#L20

Did you really mean 'backgrounded'?

Check warning on line 20 in calls/android/migrating-from-legacy-ringing.mdx

View check run for this annotation

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

calls/android/migrating-from-legacy-ringing.mdx#L20

Did you really mean 'Telecom'?
| Four pieces of app code rang the device (listener, overlay, ringtone, busy check) | The Push SDK rings, draws the incoming screen, handles busy, timeout and missed calls |
| `acceptCall` / `rejectCall` / `endCall` were HTTP calls your app had to sequence with `joinSession` | Answer = join. Decline, timeout and busy are sent by the Push SDK through a durable queue |
| Caller only knew "accepted" or "rejected" | Caller sees "Ringing…" (the callee's device was reached), "answered", and the reason a call ended (`rejected`, `busy`, `unanswered`, `cancelled`) |

Check warning on line 23 in calls/android/migrating-from-legacy-ringing.mdx

View check run for this annotation

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

calls/android/migrating-from-legacy-ringing.mdx#L23

Did you really mean 'callee's'?
| Chat SDK required for calling | Chat SDK needed for chat only; a calls-only app works |

## Before and after
Expand Down Expand Up @@ -74,11 +74,11 @@
}
```

- `minSdk` 26 or higher.
- `minSdk` 26 or higher (28 with the UI Kit, its own floor).
- `compileSdk` 36 and Android Gradle Plugin 8.9.1 or later: the Push Notifications SDK 2.0 depends on `androidx.core` 1.18, which requires them.

Check warning on line 78 in calls/android/migrating-from-legacy-ringing.mdx

View check run for this annotation

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

calls/android/migrating-from-legacy-ringing.mdx#L78

Did you really mean 'Gradle'?
- Keep your Firebase Messaging dependency and `google-services.json`; the Push SDK never compiles against Firebase.

Adding the `push-notifications-calls-android` artifact turns ringing on. There is no second initialiser.

Check warning on line 81 in calls/android/migrating-from-legacy-ringing.mdx

View check run for this annotation

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

calls/android/migrating-from-legacy-ringing.mdx#L81

Did you really mean 'initialiser'?

## Step 2: Replace the push configuration

Expand Down Expand Up @@ -121,7 +121,7 @@
if (CometChatPushNotifications.isAppInForeground() && isCallPush(message.data)) {
return // the WebSocket CallListener handles it
}
CometChatPushNotifications.handlePushNotification(this, title, body, icon, uid, guid, message.data)

Check warning on line 124 in calls/android/migrating-from-legacy-ringing.mdx

View check run for this annotation

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

calls/android/migrating-from-legacy-ringing.mdx#L124

Did you really mean 'uid'?

Check warning on line 124 in calls/android/migrating-from-legacy-ringing.mdx

View check run for this annotation

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

calls/android/migrating-from-legacy-ringing.mdx#L124

Did you really mean 'guid'?
}

override fun onNewToken(token: String) {
Expand Down Expand Up @@ -151,7 +151,7 @@

## Step 4: Delete the token code

The Push SDK registers the token on login and unregisters it on logout by itself. Remove:

Check warning on line 154 in calls/android/migrating-from-legacy-ringing.mdx

View check run for this annotation

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

calls/android/migrating-from-legacy-ringing.mdx#L154

Did you really mean 'unregisters'?

- `FirebaseMessaging.getInstance().token` + `registerToken(...)` / `CometChatNotifications.registerPushToken(...)` after login
- `unregisterToken(...)` / `unregisterPushToken(...)` before logout
Expand All @@ -161,7 +161,7 @@
Everything in this list is now done by the Push SDK. Remove it, or it will fight the SDK's ring (two ringtones, two screens, a busy reject sent on top of the SDK's).

- The Application-level `CometChat.addCallListener(...)` and its `onIncomingCallReceived` handler
- The incoming-call overlay, snackbar, dialog or activity you launched from it

Check warning on line 164 in calls/android/migrating-from-legacy-ringing.mdx

View check run for this annotation

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

calls/android/migrating-from-legacy-ringing.mdx#L164

Did you really mean 'snackbar'?
- Your own ringtone / sound manager for incoming calls
- The "already in a call → reject with busy" check
- `CometChatVoIP`, `PhoneAccount` registration, `CometChatVoIPConnectionService`, `CallConnection`, and your own `READ_PHONE_STATE` and `ANSWER_PHONE_CALLS` requests. (`MANAGE_OWN_CALLS` still merges in from the Calls SDK's manifest; leave it.)
Expand All @@ -174,11 +174,11 @@
| Legacy | Now | Notes |
|--------|-----|-------|
| `CometChat.initiateCall(Call(uid, RECEIVER_TYPE_USER, type), listener)` | `CometChatCalls.initiateCall(context, uid, InitiateCallOptions, listener<InitiatedCall>)` | Set `options.sessionSettings` with the session type, or an audio call opens the camera, and with `setPeerCall(true)` for a 1:1 call |
| `CometChat.initiateCall(call, timeoutSeconds, listener)` | No client timeout. The callee's device rings for 45 s (or the push's `ringTimeout`) and then ends the call as `unanswered` | Run your own 45 s timer on the caller: if the callee's device is never reached, nothing else ends the caller's ringing for 5 minutes |

Check warning on line 177 in calls/android/migrating-from-legacy-ringing.mdx

View check run for this annotation

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

calls/android/migrating-from-legacy-ringing.mdx#L177

Did you really mean 'callee's'?

Check warning on line 177 in calls/android/migrating-from-legacy-ringing.mdx

View check run for this annotation

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

calls/android/migrating-from-legacy-ringing.mdx#L177

Did you really mean 'callee's'?
| `CallListener.onIncomingCallReceived(call)` | Nothing to write; the Push SDK rings. For your own state use `IncomingCallListener.onIncomingCallReceived(InitiatedCall)` | One listener whether the call came by push on a killed process or on a live one |
| `CallListener.onOutgoingCallAccepted(call)` | `ParticipantEventListener.onParticipantJoined(participant)` on the session `initiateCall` prepared, via `CometChatCalls.getActiveSession()` | New in-between event: `onParticipantConnected` = the callee's device is ringing |

Check warning on line 179 in calls/android/migrating-from-legacy-ringing.mdx

View check run for this annotation

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

calls/android/migrating-from-legacy-ringing.mdx#L179

Did you really mean 'callee's'?
| `CallListener.onOutgoingCallRejected(call)` | `IncomingCallListener.onIncomingCallEnded(call, "rejected")` or `"busy"` | |
| `CallListener.onIncomingCallCancelled(call)` | `IncomingCallListener.onIncomingCallEnded(call, "cancelled")` on the callee; the Push SDK has already stopped the ring | |

Check warning on line 181 in calls/android/migrating-from-legacy-ringing.mdx

View check run for this annotation

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

calls/android/migrating-from-legacy-ringing.mdx#L181

Did you really mean 'callee'?
| `CallListener.onCallEndedMessageReceived(call)` | `SessionStatusListener.onSessionLeft()` / `onConnectionClosed()` on the joined session; `onIncomingCallEnded(call, "unanswered")` while ringing | |
| `CometChat.acceptCall(sessionId, listener)` then `joinSession` | Your answer activity reads `CallBundles.getCall(intent)` and calls `joinSession`. Nothing else to send | The Push SDK asked for mic/camera before opening it |
| `CometChat.rejectCall(sessionId, CALL_STATUS_REJECTED, listener)` | Push SDK Decline button. Own incoming screen: `CometChatCallNotifications.decline(context, sessionId)` | Sends `busy` automatically when in another call |
Expand All @@ -188,7 +188,7 @@
| `CometChat.getActiveCall()` / `clearActiveCall()` | `CometChatCalls.getActiveSession()` (null when no session is prepared or joined) | |
| `CometChat.startCall(...)`, `CallSettings`, `OngoingCallListener` | `joinSession` + the 5.x listeners (see the [v5 migration guide](/calls/android/migration-guide-v5)) | |
| `CometChatCallsConstants.*` | `com.cometchat.calls.constants.Constants.*` | The whole `CometChatCallsConstants` class has been deprecated since 5.0 |
| `CometChat.logout(...)` | `CometChatCalls.logout(...)` as well | Otherwise the Calls SDK stays signed in as the old user and a ring is not stopped |
| `CometChat.logout(...)` | `CometChatCalls.logout(...)` as well (the UI Kit's `CometChatUIKit.logout` does both) | Otherwise the Calls SDK stays signed in as the old user and a ring is not stopped |

### Caller screen, before and after

Expand Down Expand Up @@ -228,7 +228,7 @@
</Tab>
</Tabs>

### Callee screen, before and after

Check warning on line 231 in calls/android/migrating-from-legacy-ringing.mdx

View check run for this annotation

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

calls/android/migrating-from-legacy-ringing.mdx#L231

Did you really mean 'Callee'?

<Tabs>
<Tab title="Before">
Expand Down Expand Up @@ -260,10 +260,19 @@

## Step 7: Change the logout

<Tabs>
<Tab title="Calls SDK app">
```kotlin
CometChat.logout(chatCallback)
CometChatCalls.logout(callsCallback) // new: stops a ringing call, unregisters the push token

Check warning on line 267 in calls/android/migrating-from-legacy-ringing.mdx

View check run for this annotation

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

calls/android/migrating-from-legacy-ringing.mdx#L267

Did you really mean 'unregisters'?
```
</Tab>
<Tab title="UI Kit app">
```kotlin
CometChatUIKit.logout(callback) // instead of CometChat.logout: logs out of Chat and Calls
```
</Tab>
</Tabs>

## If you drew your own incoming-call screen

Expand All @@ -279,7 +288,7 @@

## While some users are still on legacy ringing

Your users don't all update at once, so during the rollout one CometChat app has devices on both flows. A device's flow comes from its push registration: a device on the Calls SDK 5.1 and Push Notifications SDK 2.0 receives only the call-initiated push, and a device still on legacy ringing keeps receiving the legacy call events.

Check warning on line 291 in calls/android/migrating-from-legacy-ringing.mdx

View check run for this annotation

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

calls/android/migrating-from-legacy-ringing.mdx#L291

Did you really mean 'rollout'?

To let users on the two flows call each other, turn on **Connect legacy ringing** in the CometChat dashboard under **Voice & Video Calls → Settings**. CometChat then also sends calls made on this flow as legacy call events, so devices on either flow ring for calls from the other.

Expand All @@ -290,15 +299,15 @@
## What users will notice

- Calls ring with the app killed, from the lock screen, without a `ConnectionService`.
- The caller sees "Ringing…" once the callee's phone is reached, and the reason when a call is declined or missed.

Check warning on line 302 in calls/android/migrating-from-legacy-ringing.mdx

View check run for this annotation

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

calls/android/migrating-from-legacy-ringing.mdx#L302

Did you really mean 'callee's'?
- The callee stops ringing after 45 seconds and the caller's screen closes with it (and on its own timer, if the callee's device was never reached).

Check warning on line 303 in calls/android/migrating-from-legacy-ringing.mdx

View check run for this annotation

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

calls/android/migrating-from-legacy-ringing.mdx#L303

Did you really mean 'callee'?

Check warning on line 303 in calls/android/migrating-from-legacy-ringing.mdx

View check run for this annotation

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

calls/android/migrating-from-legacy-ringing.mdx#L303

Did you really mean 'callee's'?
- Missed calls appear as notifications on the callee.

Check warning on line 304 in calls/android/migrating-from-legacy-ringing.mdx

View check run for this annotation

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

calls/android/migrating-from-legacy-ringing.mdx#L304

Did you really mean 'callee'?
- A call during a call is call waiting (answer ends the current call, decline sends busy), not an automatic reject.
- The microphone and camera prompt appears on Answer the first time, on the device that answers.

## Checklist

- [ ] Dependencies bumped, `push-notifications-calls-android` added, `minSdk 26`
- [ ] Dependencies bumped, `push-notifications-calls-android` added, `minSdk 26` (28 with the UI Kit)
- [ ] `PNConfiguration` has `setProviderId` and `setAnswerActivity`
- [ ] Firebase service passes every push to `handlePushNotification` with `message.sentTime`
- [ ] Manual token registration removed
Expand All @@ -310,5 +319,5 @@
- [ ] Logout also logs out of the Calls SDK
- [ ] `ensureRingReady` runs after sign-in and anything other than `READY` is shown to the user
- [ ] Call pushes are sent at high FCM priority
- [ ] **Connect legacy ringing** is on in the dashboard if some users stay on legacy ringing during the rollout

Check warning on line 322 in calls/android/migrating-from-legacy-ringing.mdx

View check run for this annotation

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

calls/android/migrating-from-legacy-ringing.mdx#L322

Did you really mean 'rollout'?
- [ ] Tested: ring with the app killed, decline, cancel, no answer, call during a call, logout while ringing
2 changes: 1 addition & 1 deletion calls/android/ringing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
description: "Ring users on Android with the CometChat Calls SDK and the Push Notifications SDK: start a call, show it ringing, answer, decline, cancel and end it, with the app in any state."
---

Ringing lets one user call another and lets the callee answer or decline, whether the callee's app is in the foreground, in the background or not running at all.

Check warning on line 8 in calls/android/ringing.mdx

View check run for this annotation

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

calls/android/ringing.mdx#L8

Did you really mean 'callee'?

Check warning on line 8 in calls/android/ringing.mdx

View check run for this annotation

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

calls/android/ringing.mdx#L8

Did you really mean 'callee's'?

Two SDKs do the work:

Check warning on line 10 in calls/android/ringing.mdx

View check run for this annotation

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

calls/android/ringing.mdx#L10

Did you really mean 'SDKs'?

| SDK | Owns |
|-----|------|
| **Calls SDK** (`calls-sdk-android` 5.1+) | Creating the call, the media session, answering, declining, cancelling, ending, and the call events your code listens to |
| **Push Notifications SDK, calls module** (`push-notifications-calls-android` 2.0+) | Ringing the callee's device: the call notification, the full-screen incoming-call screen, the ringtone, the ring timeout, missed calls and busy handling |

Check warning on line 15 in calls/android/ringing.mdx

View check run for this annotation

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

calls/android/ringing.mdx#L15

Did you really mean 'callee's'?

<Note>
**Coming from the earlier ringing flow?** The Chat SDK's calling methods (`CometChat.initiateCall`, `acceptCall`, `rejectCall`, `endCall`, `CallListener`) are superseded by the Calls SDK and no longer used; a coming Chat SDK release marks them deprecated. This page describes the replacement. See [Migrating from legacy ringing](/calls/android/migrating-from-legacy-ringing) for a method-by-method mapping.
Expand All @@ -20,7 +20,7 @@

## How ringing works

The caller creates the call with the Calls SDK. The CometChat backend sends a push to the callee. The Push SDK rings the callee's device, and when the callee answers, your call screen joins the session. The caller's app learns that the callee is ringing and has answered from the Calls SDK, without joining the session first.

Check warning on line 23 in calls/android/ringing.mdx

View check run for this annotation

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

calls/android/ringing.mdx#L23

Did you really mean 'callee'?

Check warning on line 23 in calls/android/ringing.mdx

View check run for this annotation

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

calls/android/ringing.mdx#L23

Did you really mean 'callee's'?

Check warning on line 23 in calls/android/ringing.mdx

View check run for this annotation

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

calls/android/ringing.mdx#L23

Did you really mean 'callee'?

Check warning on line 23 in calls/android/ringing.mdx

View check run for this annotation

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

calls/android/ringing.mdx#L23

Did you really mean 'callee'?

```mermaid
sequenceDiagram
Expand All @@ -43,12 +43,12 @@

What each side sees:

| Stage | Caller | Callee |

Check warning on line 46 in calls/android/ringing.mdx

View check run for this annotation

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

calls/android/ringing.mdx#L46

Did you really mean 'Callee'?
|-------|--------|--------|
| Call created | `initiateCall` succeeds; show "Calling…" | Push arrives; the Push SDK rings |
| Callee's device reached | `onParticipantConnected` → show "Ringing…" | Ringing |

Check warning on line 49 in calls/android/ringing.mdx

View check run for this annotation

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

calls/android/ringing.mdx#L49

Did you really mean 'Callee's'?
| Callee answers | `onParticipantJoined` → `joinSession` | Answer activity opens → `joinSession` |

Check warning on line 50 in calls/android/ringing.mdx

View check run for this annotation

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

calls/android/ringing.mdx#L50

Did you really mean 'Callee'?
| Callee declines / is busy / does not answer | `onIncomingCallEnded(call, "rejected" / "busy" / "unanswered")` | Ring stops; missed call if unanswered |

Check warning on line 51 in calls/android/ringing.mdx

View check run for this annotation

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

calls/android/ringing.mdx#L51

Did you really mean 'Callee'?
| Caller cancels | — (you ended it) | Ring stops; missed call |
| Either side hangs up | `onParticipantLeft` / `onSessionLeft` | same |

Expand All @@ -57,7 +57,7 @@
- [Calls SDK set up](/calls/android/setup) and the user [logged in](/calls/android/authentication).
- Push notifications configured with the Push Notifications SDK 2.0 calls module. The whole push side of ringing is on the [Push ringing](/calls/android/voip-calling) page; this page assumes it is done.
- `RECORD_AUDIO` and `CAMERA` granted at runtime. The Calls SDK's manifest already declares them, so there is nothing to add to yours.
- `minSdk 26`, `compileSdk 36` and Android Gradle Plugin 8.9.1 or later: the Push Notifications SDK 2.0 depends on `androidx.core` 1.18, which requires them.

Check warning on line 60 in calls/android/ringing.mdx

View check run for this annotation

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

calls/android/ringing.mdx#L60

Did you really mean 'Gradle'?

```kotlin build.gradle.kts
dependencies {
Expand All @@ -73,7 +73,7 @@

## Start a call

`CometChatCalls.initiateCall` creates the call on the backend, which rings the callee, and prepares the caller's media session. The caller does **not** join yet.

Check warning on line 76 in calls/android/ringing.mdx

View check run for this annotation

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

calls/android/ringing.mdx#L76

Did you really mean 'callee'?

<Tabs>
<Tab title="Kotlin">
Expand All @@ -87,7 +87,7 @@
.build()
}

CometChatCalls.initiateCall(context, receiverUid, options,

Check warning on line 90 in calls/android/ringing.mdx

View check run for this annotation

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

calls/android/ringing.mdx#L90

Did you really mean 'receiverUid'?
object : CometChatCalls.CallbackListener<InitiatedCall>() {
override fun onSuccess(call: InitiatedCall) {
Log.d(TAG, "Calling ${call.receiver}, session ${call.sessionId}")
Expand Down Expand Up @@ -145,12 +145,12 @@
</Warning>

<Note>
There is no client-side ring timeout. The callee's device stops at the ring window the backend sends in the push (45 seconds by default) and ends the call as `unanswered`, which closes the caller's call too. If the callee's device is never reached, nothing ends the caller's ringing until its prepared session expires after 5 minutes, so run your own timer on the caller and end the call as `unanswered` after the same window, as shown under [Ring timeout](#ring-timeout).

Check warning on line 148 in calls/android/ringing.mdx

View check run for this annotation

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

calls/android/ringing.mdx#L148

Did you really mean 'callee's'?

Check warning on line 148 in calls/android/ringing.mdx

View check run for this annotation

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

calls/android/ringing.mdx#L148

Did you really mean 'callee's'?
</Note>

## Show "Ringing…" and detect the answer

The caller stays on the session that `initiateCall` prepared and listens to it. Do not call `joinSession` yet: joining only when the callee has joined keeps the caller's media off until there is someone to talk to, and it is what makes the two events below arrive.

Check warning on line 153 in calls/android/ringing.mdx

View check run for this annotation

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

calls/android/ringing.mdx#L153

Did you really mean 'callee'?

<Tabs>
<Tab title="Kotlin">
Expand Down Expand Up @@ -217,8 +217,8 @@

| Event | On the prepared session it means |
|-------|----------------------------------|
| `onParticipantConnected(callee)` | The callee's phone got the push: it is ringing there |

Check warning on line 220 in calls/android/ringing.mdx

View check run for this annotation

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

calls/android/ringing.mdx#L220

Did you really mean 'callee's'?
| `onParticipantJoined(callee)` | The callee answered. Call `joinSession` now |

Check warning on line 221 in calls/android/ringing.mdx

View check run for this annotation

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

calls/android/ringing.mdx#L221

Did you really mean 'callee'?
| `onConnectionClosed` | The call ended before anyone joined (declined, cancelled from another device, the session died, or the prepared session expired after 5 minutes). `onSessionTimedOut` is not part of this: it only reports an idle joined session |

Both listeners are lifecycle-aware: pass your activity or fragment as the `LifecycleOwner` and the SDK removes them when it is destroyed.
Expand All @@ -239,7 +239,7 @@
override fun onIncomingCallEnded(call: InitiatedCall, reason: String) {
// Callee: the ring ended (caller cancelled, answered elsewhere, timed out).
// Caller: your outgoing call ended with reason "rejected", "busy", "cancelled" or "unanswered".
if (call.sessionId == currentSessionId) closeOutgoingScreen(reason)

Check warning on line 242 in calls/android/ringing.mdx

View check run for this annotation

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

calls/android/ringing.mdx#L242

Did you really mean 'sessionId'?
}
})

Expand Down Expand Up @@ -272,9 +272,9 @@

| Who | `onIncomingCallEnded` reason |
|-----|------------------------------|
| Caller | `rejected` (callee declined), `busy` (callee was in another call), `unanswered` (nobody answered), `cancelled` (you cancelled from another device), when a push delivers them through the Push SDK. The Calls SDK doesn't report them on its own, so keep your ring timer. |

Check warning on line 275 in calls/android/ringing.mdx

View check run for this annotation

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

calls/android/ringing.mdx#L275

Did you really mean 'callee'?
| Callee, still ringing | `cancelled` (caller gave up), `ongoing` (answered on another device), `rejected` / `busy` (declined on another device), `unanswered` (ring timed out), `ended` (the prepared session closed before the answer; it fires once per call, so a later `cancelled` push is not reported). Treat any other reason as "the ring is over" |

Check warning on line 276 in calls/android/ringing.mdx

View check run for this annotation

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

calls/android/ringing.mdx#L276

Did you really mean 'Callee'?
| Callee, answered | Nothing; the joined session reports the end through `onSessionLeft` / `onConnectionClosed` |

Check warning on line 277 in calls/android/ringing.mdx

View check run for this annotation

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

calls/android/ringing.mdx#L277

Did you really mean 'Callee'?

<Warning>
Listener ids are keys. Registering the same id twice replaces the first listener instead of adding a second one, so give each screen a stable id and remove it when the screen is destroyed.
Expand Down Expand Up @@ -327,12 +327,12 @@

## Join the session

Both sides join the same way: the callee from the answer activity, the caller from `onParticipantJoined`. `joinSession` takes over the session that was prepared earlier, so it connects almost at once. On a prepared session the settings passed to `joinSession` are ignored: the ones frozen when the session was prepared apply. That is the caller's `options.sessionSettings`; the callee's session is prepared by the Push SDK with its own settings (session type and peer call), so layout or hidden-button settings passed by the callee have no effect.

Check warning on line 330 in calls/android/ringing.mdx

View check run for this annotation

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

calls/android/ringing.mdx#L330

Did you really mean 'callee'?

Check warning on line 330 in calls/android/ringing.mdx

View check run for this annotation

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

calls/android/ringing.mdx#L330

Did you really mean 'callee's'?

<Tabs>
<Tab title="Kotlin">
```kotlin
fun joinCallSession(sessionId: String, callType: String) {

Check warning on line 335 in calls/android/ringing.mdx

View check run for this annotation

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

calls/android/ringing.mdx#L335

Did you really mean 'callType'?
val container = findViewById<RelativeLayout>(R.id.call_view_container)
val isVideo = callType.equals(Constants.SESSION_TYPE_VIDEO, ignoreCase = true)

Expand Down Expand Up @@ -409,7 +409,7 @@

## Cancel a call

The caller ends a call that is still ringing with `endCall` and the `cancelled` status. The callee's ring stops and a missed call is posted there.

Check warning on line 412 in calls/android/ringing.mdx

View check run for this annotation

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

calls/android/ringing.mdx#L412

Did you really mean 'callee's'?

<Tabs>
<Tab title="Kotlin">
Expand Down Expand Up @@ -448,7 +448,7 @@

## Ring timeout

The callee's Push SDK ends an unanswered 1:1 call as `unanswered` when its ring window closes (45 seconds unless the push carries a `ringTimeout`). To close the caller's screen at the same moment even if that signal is late, run your own timer from `initiateCall` and end the call with the same status:

Check warning on line 451 in calls/android/ringing.mdx

View check run for this annotation

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

calls/android/ringing.mdx#L451

Did you really mean 'callee's'?

<Tabs>
<Tab title="Kotlin">
Expand All @@ -475,7 +475,7 @@

## End a call

Hang up by leaving the session. In a 1:1 call, set `setPeerCall(true)` before the session is prepared, or a caller who cancels while the callee is joining leaves the callee alone in the room. The room tells the other side, which receives `onParticipantLeft` and then `onSessionLeft` or `onConnectionClosed`. No status needs to be sent and the call is logged by the backend.

Check warning on line 478 in calls/android/ringing.mdx

View check run for this annotation

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

calls/android/ringing.mdx#L478

Did you really mean 'callee'?

<Tabs>
<Tab title="Kotlin">
Expand Down Expand Up @@ -551,7 +551,7 @@

## Logout

Log out of the Calls SDK when the user signs out (`CometChatCalls.logout`). On that logout the Push SDK stops a call still ringing for the old user and unregisters the push token. Logging out of the Chat SDK alone leaves the Calls SDK signed in, so a ring keeps playing for the old user and later declines go out with the old token.
Log out of the Calls SDK when the user signs out (`CometChatCalls.logout`, or `CometChatUIKit.logout` when you use the UI Kit). On that logout the Push SDK stops a call still ringing for the old user and unregisters the push token. Logging out of the Chat SDK alone leaves the Calls SDK signed in, so a ring keeps playing for the old user and later declines go out with the old token.

Check warning on line 554 in calls/android/ringing.mdx

View check run for this annotation

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

calls/android/ringing.mdx#L554

Did you really mean 'unregisters'?

End or cancel any call of your own before logging out; the Calls SDK cannot send after the session is gone.

Expand All @@ -560,11 +560,11 @@
| Status | Meaning | Sent by |
|--------|---------|---------|
| `initiated` | Created, ringing | Backend, on `initiateCall` |
| `ongoing` | Answered | Backend, when the callee joins |

Check warning on line 563 in calls/android/ringing.mdx

View check run for this annotation

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

calls/android/ringing.mdx#L563

Did you really mean 'callee'?
| `rejected` | Callee declined | Callee's Push SDK |

Check warning on line 564 in calls/android/ringing.mdx

View check run for this annotation

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

calls/android/ringing.mdx#L564

Did you really mean 'Callee'?

Check warning on line 564 in calls/android/ringing.mdx

View check run for this annotation

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

calls/android/ringing.mdx#L564

Did you really mean 'Callee's'?
| `busy` | Callee was in another call | Callee's Push SDK |

Check warning on line 565 in calls/android/ringing.mdx

View check run for this annotation

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

calls/android/ringing.mdx#L565

Did you really mean 'Callee'?

Check warning on line 565 in calls/android/ringing.mdx

View check run for this annotation

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

calls/android/ringing.mdx#L565

Did you really mean 'Callee's'?
| `cancelled` | Caller ended it before an answer | Caller, `endCall` |
| `unanswered` | Nobody answered in the ring window | Callee's Push SDK (and optionally the caller's timer) |

Check warning on line 567 in calls/android/ringing.mdx

View check run for this annotation

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

calls/android/ringing.mdx#L567

Did you really mean 'Callee's'?
| `ended` | Hung up after being answered | Backend, when the session ends |
| `missed` | How an unanswered or cancelled incoming call appears in call logs | Call logs |

Expand Down
2 changes: 1 addition & 1 deletion calls/android/troubleshooting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

| Symptom | Cause | Fix |
| --- | --- | --- |
| Gradle sync fails, or `org.jitsi:webrtc` cannot be resolved | A repository is missing or the version does not match | Declare `google()`, `mavenCentral()` and `maven { url 'https://dl.cloudsmith.io/public/cometchat/cometchat/maven/' }` in your repositories (`settings.gradle` or the project `build.gradle`). WebRTC comes from Maven Central. See [Setup](/calls/android/setup) |

Check warning on line 11 in calls/android/troubleshooting.mdx

View check run for this annotation

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

calls/android/troubleshooting.mdx#L11

Did you really mean 'Gradle'?
| `init()` fails silently | Invalid App ID or Region | Double-check credentials from the [CometChat Dashboard](https://app.cometchat.com/) |
| Duplicate class errors | Conflicting WebRTC or transitive dependencies | Exclude conflicting modules in your `build.gradle` dependencies block |
| `minSdkVersion` error | SDK requires higher minimum API level | Set `minSdkVersion` to 26 or higher |
Expand Down Expand Up @@ -55,7 +55,7 @@
| Rings, then the process dies before Answer | Call push sent at normal FCM priority (`BFGS denied`) | Send call pushes at high priority |
| Caller never sees "Ringing…" / answered | Caller joined right after `initiateCall` | Stay on the prepared session and join on `onParticipantJoined`. See [Ringing](/calls/android/ringing) |
| Audio call opens the camera | Session type not set at `initiateCall` | Pass `sessionSettings` with `setSessionType(SessionType.VOICE)` in `InitiateCallOptions` |
| Ring keeps playing after logout | Only the Chat SDK was logged out | Call `CometChatCalls.logout` too |
| Ring keeps playing after logout | Only the Chat SDK was logged out | Call `CometChatCalls.logout` too (or `CometChatUIKit.logout`) |
| App killed by OS during call | Missing foreground service notification | Show a persistent notification during active calls |

---
Expand Down
7 changes: 5 additions & 2 deletions calls/android/voip-calling.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
description: "Ring incoming CometChat calls on Android with the Push Notifications SDK 2.0 calls module: FCM setup, configuration, the answer activity, permissions, missed calls and your own ring screen."
---

The Push Notifications SDK's calls module turns a CometChat call push into a ringing phone: a call-style notification with Answer and Decline, a full-screen screen over the lock screen, the ringtone, a ring timeout, missed-call notifications and busy handling. It works with the app in the foreground, in the background or not running at all, and needs no Telecom `ConnectionService`.

Check warning on line 8 in calls/android/voip-calling.mdx

View check run for this annotation

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

calls/android/voip-calling.mdx#L8

Did you really mean 'Telecom'?

This page covers the push side of ringing. Starting, answering and ending calls with the Calls SDK is on the [Ringing](/calls/android/ringing) page.

Expand All @@ -28,7 +28,7 @@
- [Calls SDK 5.1 set up](/calls/android/setup) and the user logged in.
- A Firebase project with your Android app, `google-services.json` in the app module, and the Firebase Messaging dependency. The Push SDK never compiles against Firebase; you own it.
- Push notifications enabled in the CometChat dashboard with an **FCM** provider, and that provider's id.
- `minSdk 26`, `compileSdk 36` and Android Gradle Plugin 8.9.1 or later: the Push Notifications SDK 2.0 depends on `androidx.core` 1.18, which requires them.

Check warning on line 31 in calls/android/voip-calling.mdx

View check run for this annotation

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

calls/android/voip-calling.mdx#L31

Did you really mean 'Gradle'?

## Step 1: Add the dependencies

Expand Down Expand Up @@ -84,7 +84,7 @@
| `setIncomingCallActivity(Class?)` | the SDK's own screen | Your full-screen ring screen; see [Your own incoming-call screen](#your-own-incoming-call-screen) |
| `setIncomingCallTheme(theme?)` | none | Colours of the SDK's incoming-call screen and call notifications, light and dark; see [Theming the SDK's incoming-call screen](#theming-the-sdks-incoming-call-screen) |
| `setMissedCallActivity(Class?)` | none | Opened when a missed-call notification is tapped. Without it an individual missed-call notification has no tap action |
| `setNotificationSmallIcon(res)` | a system mail icon | Status-bar icon for chat notifications. Call notifications use the drawables `cometchat_pn_ic_notification_call` and `cometchat_pn_ic_notification_call_missed`; override those by name |

Check warning on line 87 in calls/android/voip-calling.mdx

View check run for this annotation

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

calls/android/voip-calling.mdx#L87

Did you really mean 'drawables'?
| `setDefaultRingTimeoutMs(ms)` | 45 000 | Ring window when the push carries no `ringTimeout`; 1 s to 10 min |
| `setShowMissedCallNotification(bool)` | `true` | Post a missed-call notification |
| `setRequestCallPermissions(bool)` | `true` | Ask for microphone (and camera) on Answer |
Expand Down Expand Up @@ -312,7 +312,7 @@

## Tokens and logout

You do not register the push token: the SDK registers it on login and unregisters it on logout. Log out of the Calls SDK when the user signs out (`CometChatCalls.logout`). That stops a ring still playing for the old user and unregisters the token. `CometChat.logout` alone unregisters the token but does not stop a ring or sign out of the Calls SDK.
You do not register the push token: the SDK registers it on login and unregisters it on logout. Log out of the Calls SDK when the user signs out (`CometChatCalls.logout`, or `CometChatUIKit.logout` with the UI Kit). That stops a ring still playing for the old user and unregisters the token. `CometChat.logout` alone unregisters the token but does not stop a ring or sign out of the Calls SDK.

Check warning on line 315 in calls/android/voip-calling.mdx

View check run for this annotation

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

calls/android/voip-calling.mdx#L315

Did you really mean 'unregisters'?

Check warning on line 315 in calls/android/voip-calling.mdx

View check run for this annotation

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

calls/android/voip-calling.mdx#L315

Did you really mean 'unregisters'?

Check warning on line 315 in calls/android/voip-calling.mdx

View check run for this annotation

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

calls/android/voip-calling.mdx#L315

Did you really mean 'unregisters'?

## Your own incoming-call screen

Expand Down Expand Up @@ -408,7 +408,7 @@
The SDK's incoming-call screen and its call notifications take each colour from, in order:

1. a `CometChatPNIncomingCallTheme` set in code;
2. the `cometchat_pn_call_*` colour resources, which your app can override by name;
2. the `cometchat_pn_call_*` colour resources, which your app (or a UI Kit) can override by name;
3. the SDK's defaults.

Each colour is looked up on its own, so a theme can set only the colours it cares about.
Expand Down Expand Up @@ -475,7 +475,7 @@
);

// Later, when your app's theme changes. Pass null to remove it.
CometChatPushNotifications.setIncomingCallTheme(context, newTheme);

Check warning on line 478 in calls/android/voip-calling.mdx

View check run for this annotation

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

calls/android/voip-calling.mdx#L478

Did you really mean 'newTheme'?
```
</Tab>
</Tabs>
Expand Down Expand Up @@ -514,10 +514,13 @@
<color name="cometchat_pn_call_decline">#F44649</color>
```

The strings, drawables and layout of the screen (all prefixed `cometchat_pn_`) can be overridden the same way. A replacement layout must keep the ids `cometchat_pn_initials`, `cometchat_pn_caller_name`, `cometchat_pn_call_type`, `cometchat_pn_answer` and `cometchat_pn_decline`.

Check warning on line 517 in calls/android/voip-calling.mdx

View check run for this annotation

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

calls/android/voip-calling.mdx#L517

Did you really mean 'drawables'?

On Android 12 and later the Answer and Decline buttons in the notification are drawn by the system, so there only the accent colour and the avatar take your colours.

<Note>
If you use the CometChat UI Kit, it already overrides the colour resources with its own light and dark palette, and can pass your UI Kit theme as a `CometChatPNIncomingCallTheme`; see [Calling integration](/ui-kit/android/calling-integration). Your app's own theme and resources still win over the UI Kit's.
</Note>

## Knowing about a call in your own code

Expand Down
1 change: 1 addition & 0 deletions docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -1784,6 +1784,7 @@
"ui-kit/android/threaded-messages-header",
"ui-kit/android/incoming-call",
"ui-kit/android/outgoing-call",
"ui-kit/android/ongoing-call",
"ui-kit/android/call-buttons",
"ui-kit/android/call-logs",
"ui-kit/android/search",
Expand Down
39 changes: 27 additions & 12 deletions notifications/android-push-notifications.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
description: "Set up FCM and the CometChat Push Notifications SDK 2.0 on Android for message notifications with inline reply and call ringing."
---

<Card
title="Android UI Kit push sample apps (Kotlin and Compose)"
icon="github"
href="https://github.com/cometchat/cometchat-uikit-android"
>
Reference implementations: `sample-app-kotlin-push` and `sample-app-compose-push`.
</Card>

## What this guide covers

- FCM setup and the CometChat provider (credentials, Gradle, manifest).
Expand Down Expand Up @@ -42,22 +50,24 @@

## 2. Add dependencies (Gradle)

Two CometChat artifacts, published in lockstep. The calls one is optional: add it to make incoming calls ring.
The Push Notifications SDK is two artifacts, published in lockstep. The calls one is optional: add it to make incoming calls ring. The snippet also lists the UI Kit, or the Chat and Calls SDKs, that your app already uses.

<Tabs>
<Tab title="TOML (libs.versions.toml)">

```toml lines
[versions]
minSdk = "26" # the Calls SDK's floor; 24 for the core push artifact alone
minSdk = "28" # the UI Kit's floor; 26 without the UI Kit
compileSdk = "36"
targetSdk = "36"
cometChatSdk = "5.0.7"
cometChatUikit = "6.2.0"
cometChatSdk = "5.1.1"
cometChatCalls = "5.1.0"
cometChatPush = "2.0.0"
firebaseBom = "33.7.0"

[libraries]
cometchat-uikit = { group = "com.cometchat", name = "chatuikit-kotlin-android", version.ref = "cometChatUikit" }
cometchat-sdk = { group = "com.cometchat", name = "chat-sdk-android", version.ref = "cometChatSdk" }
cometchat-calls = { group = "com.cometchat", name = "calls-sdk-android", version.ref = "cometChatCalls" }
cometchat-push = { group = "com.cometchat", name = "push-notifications-android", version.ref = "cometChatPush" }
Expand All @@ -77,12 +87,16 @@
}

android {
defaultConfig { minSdk = 26 } // the Calls SDK's floor
defaultConfig { minSdk = 28 } // the UI Kit's floor; 26 with the Chat and Calls SDKs directly
}

dependencies {
implementation(libs.cometchat.sdk) // chat; optional for a calls-only app
implementation(libs.cometchat.calls) // needed with the calls module
// UI Kit app: the UI Kit does not bundle the Calls SDK, so add both
implementation(libs.cometchat.uikit) // or chatuikit-compose-android
implementation(libs.cometchat.calls) // needed for calling (enableCalling) and for the calls module
// SDK-direct app instead:
// implementation(libs.cometchat.sdk) // chat; optional for a calls-only app
// implementation(libs.cometchat.calls) // needed with the calls module
implementation(libs.cometchat.push)
implementation(libs.cometchat.push.calls) // only if you want incoming calls to ring

Expand All @@ -94,9 +108,10 @@
</Tab>
</Tabs>

- The UI Kit bundles neither the push artifacts nor the Calls SDK; a UI Kit app adds all three.
- Apply the `google-services` plugin and place `google-services.json` in the same module.
- `minSdk`: the calls module needs 26, the Calls SDK's floor; the core artifact alone works from 24.
- `minSdk`: 28 with the UI Kit (6.2.0 or later, which initialises the Calls SDK you add). Without the UI Kit, the calls module needs 26, the Calls SDK's floor; the core artifact alone works from 24.
- `compileSdk` 36 and Android Gradle Plugin 8.9.1 or later: the Push Notifications SDK 2.0 depends on `androidx.core` 1.18, which requires them.

Check warning on line 114 in notifications/android-push-notifications.mdx

View check run for this annotation

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

notifications/android-push-notifications.mdx#L114

Did you really mean 'Gradle'?
- The Chat SDK is optional for the push SDK: a calls-only app ships without it. Chat pushes are still shown without it; delivery receipts, inline reply and tap deep links need it.

## 3. Manifest permissions and services
Expand All @@ -121,7 +136,7 @@

## 4. Initialise the SDK

In `Application.onCreate`, on every app start, after the Chat and Calls SDKs are initialised and before the user logs in. Token registration on login and logout only runs in a process where `init` ran. The configuration is also saved, so a push that wakes a killed app can still be shown before your code runs.
In `Application.onCreate`, on every app start, after the UI Kit (or the Chat and Calls SDKs) is initialised and before the user logs in. Token registration on login and logout only runs in a process where `init` ran. The configuration is also saved, so a push that wakes a killed app can still be shown before your code runs.

Check warning on line 139 in notifications/android-push-notifications.mdx

View check run for this annotation

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

notifications/android-push-notifications.mdx#L139

Did you really mean 'SDKs'?

```kotlin lines
import com.cometchat.pushnotification.CometChatPushNotifications
Expand All @@ -140,9 +155,9 @@
| Setter | Default | What it does |
| --- | --- | --- |
| `setProviderId(id)` | none; **required** | Provider the device token is registered under. Without it no token is registered |
| `setNotificationSmallIcon(res)` | a system mail icon | Status-bar icon for chat notifications. Call notifications use the drawables `cometchat_pn_ic_notification_call` and `cometchat_pn_ic_notification_call_missed`; override those by name |

Check warning on line 158 in notifications/android-push-notifications.mdx

View check run for this annotation

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

notifications/android-push-notifications.mdx#L158

Did you really mean 'drawables'?
| `setInlineReplyEnabled(bool)` | `true` | Reply action on chat notifications |
| `setAnswerActivity(Class)` | none; required with the calls module | Opened when the user answers a call, with the call in its extras; it joins the session. See [Join from the answer activity](/calls/android/voip-calling#step-4-join-from-the-answer-activity) |
| `setAnswerActivity(Class)` | none; required with the calls module | Opened when the user answers a call, with the call in its extras; it joins the session. UI Kit apps use a small activity that opens `CometChatOngoingCallActivity`; see [Calling Integration](/ui-kit/android/calling-integration#step-3-configure-push-ringing). With the SDKs directly, see [Join from the answer activity](/calls/android/voip-calling#step-4-join-from-the-answer-activity) |

Check warning on line 160 in notifications/android-push-notifications.mdx

View check run for this annotation

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

notifications/android-push-notifications.mdx#L160

Did you really mean 'SDKs'?
| `setIncomingCallActivity(Class?)` | the SDK's screen | Your own incoming-call screen |
| `setIncomingCallTheme(theme?)` | none | Colours of the SDK's incoming-call screen and call notifications, light and dark. Change it later with `CometChatPushNotifications.setIncomingCallTheme(context, theme)`; see [Theming the SDK's incoming-call screen](/calls/android/voip-calling#theming-the-sdks-incoming-call-screen) |
| `setMissedCallActivity(Class?)` | none | Opened when a missed-call notification is tapped |
Expand Down Expand Up @@ -197,9 +212,9 @@

## 6. Tokens, login and logout

You do not register the device token. The SDK fetches it from Firebase and registers it when the user logs in, re-registers it when Firebase rotates it, and unregisters it on logout.

Check warning on line 215 in notifications/android-push-notifications.mdx

View check run for this annotation

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

notifications/android-push-notifications.mdx#L215

Did you really mean 'unregisters'?

Log out of both the Chat SDK and the Calls SDK. Only a Calls SDK logout stops a call still ringing for the old user; a Chat SDK logout unregisters the token but leaves the ring and the Calls SDK session alone.
Log out through the UI Kit (`CometChatUIKit.logout`) or, with the SDKs directly, log out of both the Chat SDK and the Calls SDK. Only a Calls SDK logout stops a call still ringing for the old user; a Chat SDK logout unregisters the token but leaves the ring and the Calls SDK session alone.

Check warning on line 217 in notifications/android-push-notifications.mdx

View check run for this annotation

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

notifications/android-push-notifications.mdx#L217

Did you really mean 'SDKs'?

Check warning on line 217 in notifications/android-push-notifications.mdx

View check run for this annotation

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

notifications/android-push-notifications.mdx#L217

Did you really mean 'unregisters'?

### Permissions and ring readiness

Expand Down Expand Up @@ -273,7 +288,7 @@
} ?: Log.d(TAG, "No unreadMessageCount in payload")
```

`ShortcutBadger` uses launcher-specific APIs (Samsung, Huawei, Xiaomi, etc.) to display a badge number on the app icon. Passing `0` clears the badge.

Check warning on line 291 in notifications/android-push-notifications.mdx

View check run for this annotation

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

notifications/android-push-notifications.mdx#L291

Did you really mean 'Huawei'?

Check warning on line 291 in notifications/android-push-notifications.mdx

View check run for this annotation

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

notifications/android-push-notifications.mdx#L291

Did you really mean 'Xiaomi'?

### 7.5 Clear badge when the app opens

Expand Down Expand Up @@ -302,7 +317,7 @@

## 9. Call pushes

Handled by the calls module: it shows a call-style notification with Answer and Decline and a full-screen screen over the lock screen, plays the ringtone, asks for the microphone and camera on Answer, opens your answer activity, sends declines and timeouts, and posts missed-call notifications.
Handled by the calls module: it shows a call-style notification with Answer and Decline and a full-screen screen over the lock screen, plays the ringtone, asks for the microphone (and the camera for a video call) on Answer, opens your answer activity, sends declines and timeouts, and posts missed-call notifications. UI Kit apps add a small answer activity that opens `CometChatOngoingCallActivity`; see [Calling Integration](/ui-kit/android/calling-integration#step-3-configure-push-ringing).

Configuration, your own ring screen and theming are on [Push Ringing](/calls/android/voip-calling). Starting and ending calls is on [Ringing](/calls/android/ringing).

Expand All @@ -329,6 +344,6 @@
| Pushes stop after a while | `onNewToken` not forwarded to `handleTokenRefresh` |
| Chat notification tap does nothing | `setOnNotificationTapListener` not set, or the activity's launch mode drops extras |
| Calls do not ring | `push-notifications-calls-android` missing, `setAnswerActivity` not set, push sent at normal priority, or `ensureRingReady` not `READY` |
| Ringing continues after logout | Logged out of the Chat SDK only; log out of the Calls SDK too (`CometChatCalls.logout`) |
| Ringing continues after logout | Logged out of the Chat SDK only; log out of the Calls SDK too (`CometChatCalls.logout`, or `CometChatUIKit.logout` with the UI Kit) |
| Inline reply crashes | Do not strip FCM or `RemoteInput` classes in ProGuard/R8 |
| Badge count not showing | **Unread Badge Count** enabled in the dashboard, ShortcutBadger added, launcher supports badges (Samsung, Huawei, Xiaomi) |
Loading
Loading