Skip to content

docs(react-native): ringing through the Calls SDK and Push Notifications SDK - #562

Open
suraj-chauhan-cometchat wants to merge 6 commits into
mainfrom
feature/react-native-ringing-push-sdk
Open

suraj-chauhan-cometchat wants to merge 6 commits into
mainfrom
feature/react-native-ringing-push-sdk

Conversation

@suraj-chauhan-cometchat

Copy link
Copy Markdown
Contributor

Summary

The React Native counterpart to #561. React Native calling no longer signals through the Chat SDK. The Calls SDK 5.1 creates, joins and ends calls; the Push Notifications SDK 2.0 rings the device in every app state (foreground, background, killed); the UI Kit hosts the screens.

Consumer-facing wording is "ringing" and "legacy ringing"; the pages never say v1 or v2. Page for page this mirrors #561 — same structure, same headings, same tables — with React Native's own APIs rather than translated Kotlin.

Where React Native genuinely differs from Android

These are deliberate, not drift. Behaviour is the same; the methods are not.

Android React Native
One CometChatPushNotifications.init; the calls module is installed by reflection Two packages, and two init shapes: a calls-only app passes its config to CometChatVoipNotifications.init(config); a chat app inits the core first and calls CometChatVoipNotifications.init() with no config. Passing a config in a chat app re-runs the core init and drops every chat option — documented as a warning on every page that shows it
setAnswerActivity(...), call in the intent No answer activity. The answered call arrives as onCallAccepted, buffered natively and replayed to the first subscriber
CometChatCalls.addIncomingCallListener The Calls SDK has no such listener on RN. Incoming-call events come from the Push SDK: onCallRinging / onCallAccepted / onCallEnded / onRingEnded
joinSession(sessionId, settings, container, listener) connect(sessionId) then mount <CometChatCalls.Component callToken={…} />
Callback listeners Result<T, E> from initiateCall / endCall, and session.addEventListener(event, fn) returning an unsubscribe
setEnableCalling(true) in UIKitSettings Installing the Calls SDK package is the switch; there is no setEnableCalling on RN
App must delegate from its own FirebaseMessagingService The package ships its own service, so delegation is optional — documented as "you normally skip this step"
— registerBackgroundCallTask() at module scope in index.js, or a decline on a killed app is never delivered
— iOS half: CallKit and PushKit, the voip background mode, and the NSMicrophoneUsageDescription crash that looks exactly like a ring timeout

Calls SDK (calls/react-native/)

  • ringing.mdx rewritten: Calls SDK-only flow with a sequence diagram, initiateCall, prepared-session events ("Ringing…" / answered), the Push SDK's incoming-call events with the reason table, answering, declining, cancelling, ring timeout, ending with session.leave(), call waiting, group calls, logout, status values.
  • voip-calling.mdx rewritten as Push Ringing (slug kept, no redirect): dependencies, the two init shapes, the background task, optional FCM delegation, permissions and ensureRingReady / getDiagnostics / verifyPushSetup, how a ring ends, call during a call, missed calls, killed-app behaviour, staging hosts, tokens, own incoming-call screen, theming, MANUAL mode, reporting your own outgoing call, troubleshooting.
  • migrating-from-legacy-ringing.mdx (new, in the Migration Guide nav group): before/after diagrams, seven migration steps, a method mapping table, caller and callee screens before/after, checklist. Covers removing react-native-callkeep and react-native-voip-push-notification.
  • events: prepared-session semantics, onParticipantConnected, the Push SDK's incoming-call events, the Calls SDK login listener. setup: 5.1 floor, push packages, initialise-once warning. migration-guide-v5: a 5.0 → 5.1 section. troubleshooting: a Ringing section.

UI Kit (ui-kit/react-native/)

  • calling-integration.mdx rewritten: five steps (dependencies, init in order, the one event subscription, permissions, logout), what the kit does from there, the "Ringing… only on the push path" note, ring theming, upgrade pointer.
  • incoming-call.mdx deprecated, kept for apps that draw the in-app ring screen themselves, with a table of what to use instead.

Notifications

  • notifications/react-native-push-notifications-android.mdx and -ios.mdx: both taught ringing with CometChat.addCallListener + CometChatIncomingCall. That section is replaced with the VoIP package wiring and a pointer to the calling pages; ringInForeground, the background-task import and the troubleshooting rows that referenced the removed component are corrected.

Before merging

  • Versions are placeholders for the public releases: @cometchat/calls-sdk-react-native 5.1.0, @cometchat/push-notifications-react-native / -voip-react-native 2.0.0. Do not merge before they are published — both push packages are currently 2.0.0-alpha.1.
  • Confirm the UI Kit version that first requires Calls SDK 5.1, for the Quick Reference floors.
  • Group ringing on React Native is not settled. The pages describe the Android behaviour (ring, decline is local, nothing sent, the call carries on). Confirm with the calls team before publishing.
  • calls/react-native/setup.mdx pinned 5.0.5 and now pins 5.1.0; check that the six peer dependency versions it pins are still right for 5.1.
  • Rendered pass with mint dev (links verified by file existence only).

Related: #561 (Android).

🤖 Generated with Claude Code

…ons SDK

Rewrites the three load-bearing calling pages for the new flow and adds the
migration guide, mirroring the Android ringing PR page for page.

- calls/react-native/ringing.mdx: Calls SDK 5.1 flow, prepared-session events,
  answering through the Push SDK, decline, cancel, ring timeout, call waiting.
- calls/react-native/voip-calling.mdx -> Push Ringing: the two init shapes, the
  background task, FCM delegation (optional on RN), readiness and diagnostics,
  missed calls, killed-app behaviour, own ring screen, MANUAL mode.
- calls/react-native/migrating-from-legacy-ringing.mdx (new): before/after, seven
  steps, method mapping, caller and callee screens, checklist.
- ui-kit/react-native/calling-integration.mdx: rewritten for the new flow.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…ative pages

Push SDK 2.0 splits ringing into @cometchat/push-notifications-voip-react-native,
which rings in every app state. Replaces the CometChat.addCallListener +
CometChatIncomingCall section both pages taught with the new wiring and a pointer
to the calling pages, and corrects ringInForeground, the background-task import
and the troubleshooting rows that referred to the removed component.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
- events: prepared-session semantics, onParticipantConnected, the Push SDK's
  incoming-call events and the Calls SDK login listener.
- setup: 5.1 floor, the push packages needed for ringing, initialise-once warning.
- migration-guide-v5: a 5.0 to 5.1 section.
- troubleshooting: a Ringing section.
- ui-kit incoming-call: deprecated, with what to use instead.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@mintlify

mintlify Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
cometchat 🟢 Ready View Preview Oct 19, 2026, 12:00 PM

💡 Tip: Enable Automations to automatically generate PRs for you.

The ring pages described overriding cometchat_pn_call_* colour resources, copied
from the Android page. Those resources do not exist in the React Native package:
the ring screen builds its colours in code, so an app defining those names changes
nothing. What IS overridable on Android is the cometchat_pn_* strings — which is
also how the ring is localised — and the cometchat_pn_ic_call drawable.

Replaces the colour table on both pages with what actually works, and points
anyone who needs a branded ring at drawing their own in-app screen.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
An earlier commit on this branch warned that the Android ring screen's colours
could not be overridden. That was true when it was written and is not any more:
the SDK gained nine `cometchat_pn_call_*` colour resources, and then an
`incomingCallTheme` object with light/dark sets, a mode that follows the device,
and a runtime setter.

Replaces that warning on both pages with what actually works, in the order the
SDK resolves it: the theme, then the resource, then the default. Notes the two
things easy to get wrong — set `acceptIcon` with a light `acceptButton` or the
glyph vanishes, and the colours paint the full-screen ring, not the call-style
notification, which Android styles itself.

iOS is unchanged and stated plainly: CallKit owns that screen, the theme is
ignored there, and the native iOS SDK has the same limit.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…special

Two claims were wrong, checked against native Android's RingController and
our own voip/src/index.ts:

- A group decline DOES send `rejected`. There is no group branch in the
  decline path on any platform — `isPeerCall` is used only at `connect()`
  and in the wrong-recipient gate.
- A call that rings out sends nothing, for 1:1 AND group. `timeout()` stops
  the ring and posts a missed call locally; it never calls `endCall`. The
  caller's `unanswered` comes from the backend's own ring window.

So the split between 1:1 and group behaviour is removed, not corrected.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

This branch was successfully deployed

1 active deployment
staging — efcabc68 Deployed Oct 19, 2026 by mintlify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant