cometchat-android-v6-calls
Add voice and video calling to an Android v6 CometChat app — the Calls SDK dependency, the settings-file calling toggle, call buttons in the message header, a global incoming-call listener, outgoing/ongoing call UI, call logs, and the runtime permissions. Triggers: 'add calling to my android app', 'voice video call android cometchat', 'incoming call screen android', 'call logs android', 'why are the call buttons not showing'.
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 1.6k
- Forks
- 491
01 前言 Front Matter
- name
- cometchat-android-v6-calls
- license
- MIT
- metadata
- { "tags": "cometchat android calls voice video v6 calling compose views", "author": "CometChat", "version": "1.0.0" }
- description
- Add voice and video calling to an Android v6 CometChat app — the Calls SDK dependency, the settings-file calling toggle, call buttons in the message header, a global incoming-call listener, outgoing/ongoing call UI, call logs, and the runtime permissions. Triggers: 'add calling to my android app', 'voice video call android cometchat', 'incoming call screen android', 'call logs android', 'why are the call buttons not showing'.
- compatibility
- Android minSdk >=28; compileSdk >=36; Kotlin >=2.1; AGP >=8.9.1; JVM target 11; com.cometchat:chatuikit-kotlin-android ^6 OR com.cometchat:chatuikit-compose-android ^6 (6.1.x, verified 6.1.1); com.cometchat:calls-sdk-android ^5 (5.0.x); com.cometchat:chat-sdk-android ^5
02 资源文件 1
- 参考文档references/huddle.md13.3 KB
03 SKILL.md 正文
Ground truth: catalog
android-v6.json+features.android-v6.json(voice-video-calls) +contracts.android-v6.json(voice-video-calls) + the live pagescalling-integration,call-features,components/{call-buttons,incoming-call,outgoing-call,call-logs},guide-call-log-details. Deep Calls-SDK behavior: the/calls/androiddocs tree. Verify symbols against the catalog; fetch params from docs; never trust memory.
Companion skills (read first)
cometchat-android-v6-core— install, credentials (assets/cometchat-settings.json),initFromSettings → login → render, sizing (references/layout.md), the fetch map. Assumed here, never repeated.cometchat-android-v6-{kotlin,compose}-placement— where the incoming-call surface sits in the app shell.
Use this skill when
"add voice/video calling", "show call buttons in the chat", "handle incoming calls", "add a call history screen", "the call buttons aren't appearing", "call log details".
Calls package + version
Add the Calls SDK alongside your cohort's UI Kit artifact (never instead of it):
dependencies {
implementation("com.cometchat:chatuikit-compose-android:6.1.1") // or chatuikit-kotlin-android for XML Views
implementation("com.cometchat:calls-sdk-android:5.0.4")
}
⚠️ On 6.1.1 the simplest fix is no Jetifier at all — chat-sdk 5.0.7 dropped the pre-AndroidX transitive, and a clean app with kit 6.1.1 + calls-sdk 5.0.4 builds with
android.enableJetifier=false(verified 2026-10-15). If the app keeps Jetifier on (6.0.x, or another legacy dependency), add a Jetifier ignore-list, or the build can break the moment you add calling.calls-sdk-android5.0.x bundles a React-Native stack (react-android/hermes/react-native-webrtc), and Jetifier cannot transformreact-android-*.aar— so with Jetifier on, the build dies atcheckDebugAarMetadatawithExecution failed for JetifyTransform: react-android-0.77.2-debug.aar(the app compiled fine BEFORE calling; adding the artifact breaks it — verified 2026-09-10). These AARs are already AndroidX, so exclude them from Jetifier ingradle.properties:android.jetifier.ignorelist=react-android,hermes-android,react-native-webrtc
⚠️ The artifact and the flag are a PAIR — setting either alone leaves calling broken.
· flag
true, artifact missing → 6.0.x: app crashes at launch (initFromSettings→initCometChatCalls→NoClassDefFoundError: CometChatCalls$SessionSettingsBuilder). 6.1.1: no crash; init logsenableCalling=true but the CometChat Calls SDK is not on the classpathand calling stays off (ENG-39311, source-checked) · artifact present, flagfalse→ calling components crash when used (RuntimeException: Please call the CometChatCalls.init() method ...)⚠️ BOTH are required — the artifact alone is not enough.
uiKit.enableCalling: trueinassets/cometchat-settings.jsonis what makesinitFromSettingsinitializeCometChatCalls. Without it,CometChatCallLogsthrowsRuntimeException: Please call the CometChatCalls.init() method ...; without the artifact 6.0.x throwsNoClassDefFoundError(6.1.1 skips Calls init and calling components do nothing). Both compile fine — device-only failures (verified 2026-08-21 on 6.0.x).
The kit auto-detects the Calls SDK and activates calling. Also set "uiKit": { "enableCalling": true } in app/src/main/assets/cometchat-settings.json so CometChatUIKit.initFromSettings(...) initializes the Calls SDK through the telemetry-aware path (it auto-inits Calls when that flag is on). Dashboard: calling must be enabled for the app.
Header call buttons differ BY COHORT (verified vs 6.0.5 source; unchanged in 6.1.1):
- Views: automatic —
CometChatMessageHeader's voice/video button visibility defaults followCallsUtils.isCallingEnabled(), so the buttons render with no extra code once calling is enabled. - Compose: NOT automatic — the
CometChatMessageHeadercomposable defaultshideVoiceCallButton = trueandhideVideoCallButton = true. Pass both explicitly:
And do NOT use the header'sCometChatMessageHeader(user = user, hideVoiceCallButton = false, hideVideoCallButton = false)auxiliaryViewslot for other icons — it REPLACES the default auxiliary area that hosts the call buttons (they vanish). Extra header icons go intrailingView(seecometchat-android-v6-compose-components).
Call-flow ordering (BAKED — invariant)
- Dependency +
enableCalling→ call buttons appear in the message header (Views: nothing to wire; Compose: passhideVoiceCallButton = false, hideVideoCallButton = false— see above). initFromSettingsresolves →loginresolves (as always) — calling is unavailable before that.
⚠️ Enabling calling in an app with EXISTING sessions — force a fresh login.
CometChatUIKit.login()short-circuits when the same uid is already logged in (persisted session): it returnsonSuccessWITHOUT callingloginCometChatCalls, so the Calls SDK never gets an auth token (verified vs 6.0.5CometChatUIKit.ktlogin + on device 2026-08-25; same short-circuit in 6.1.1 source). Symptom:CometChatCallLogsshows a silent error state; logcat saysUser auth token cannot be null. When calling is FIRST enabled on an app whose users already have a session, users must re-login —CometChatUIKit.logout(...)thenCometChatUIKit.login(...)(or force a fresh login path once, e.g. on a calling-feature version bump). During development, wireonErroronCometChatCallLogsso this failure is not silent.
- Register a GLOBAL call listener so an incoming call rings from anywhere in the app — the docs recommend an
Applicationsubclass, registering before the UI Kit is used:
import com.cometchat.chat.core.Call // NOTE: chat.core, NOT chat.models
import com.cometchat.chat.core.CometChat
class BaseApplication : Application() {
companion object {
private val LISTENER_ID = "${BaseApplication::class.java.simpleName}${System.currentTimeMillis()}"
}
override fun onCreate() {
super.onCreate()
CometChat.addCallListener(LISTENER_ID, object : CometChat.CallListener() {
override fun onIncomingCallReceived(call: Call) { /* show CometChatIncomingCall over the current screen */ }
override fun onOutgoingCallAccepted(call: Call) { /* proceed to the ongoing-call surface */ }
override fun onOutgoingCallRejected(call: Call) { /* dismiss the outgoing UI */ }
override fun onIncomingCallCancelled(call: Call) { /* dismiss the incoming UI */ }
})
}
}
Register the Application class in the manifest (android:name=".BaseApplication"). Views: instantiate CometChatIncomingCall(context), set its call, set fitsSystemWindows = true, wire its error handler, and present it (dialog / full-screen overlay). Compose: hold the incoming Call in app-level state and render the incoming-call composable above your nav host — fetch the composable's params from components/incoming-call.md.
4. Permissions — request CAMERA and RECORD_AUDIO at runtime before a call starts (video needs both; audio-only needs RECORD_AUDIO); declare them in the manifest. The kit ships CometChatPermissionHandler / CometChatPermissionActivity — prefer them over a hand-rolled flow.
Note: SoLoader / bundled React-Native native libs (know this before an ACTIVE call).
calls-sdk-android5.0.x bundles a React-Native stack (react-android/hermes/react-native-webrtc), declared atruntimescope in its POM — so they land on the runtime classpath andinitFromSettingscalls-init +CometChatCallLogswork with no extra deps (verified on device: init succeeds, call logs render). An active call surface loads those native.sos, which on RN ≥ 0.76 depend onSoLoader. If an active call fails to open with aSoLoader/UnsatisfiedLinkError/NoClassDefFoundError(React/JSI/ Hermes symbols), add the RN + SoLoader artifacts on the compile classpath and init SoLoader once inApplication.onCreatebefore the first call surface:// build.gradle.kts (only if an active call throws a SoLoader/native-link error) implementation("com.facebook.react:react-android:0.77.2") // match what calls-sdk-android pulls implementation("com.facebook.soloader:soloader:0.12.1") // Application.onCreate: SoLoader.init(this, OpenSourceMergedSoMapping)Whether 5.0.x needs this for an active call is not yet settled from a single device — it is NOT needed for init or call logs. Verify with a real two-device call; treat this as the fix if (and only if) you hit that native-link error, not as an unconditional step.
Calls component / API map (BAKED closed list)
CometChatCallButtons (auto-rendered in the message header; can also be placed standalone) · CometChatIncomingCall (ringing UI — accept/decline) · CometChatOutgoingCall (dialing UI) · CometChatOngoingCall + CometChatOngoingCallActivity / CometChatCallActivity (the in-call surface) · CometChatCallLogs (call history list) + CometChatCallLogsListItem · call bubbles in the message list: CometChatCallActionBubble, CometChatMeetCallBubble · CometChatCallEvent (call events → cometchat-android-v6-events). SDK-side (build-your-own flows): CometChat.initiateCall / acceptCall / rejectCall / getActiveCall / clearActiveCall / addCallListener / removeCallListener — see core/references/docs-map.md → SDK section.
The minimum for "add calling" (contract voice-video-calls): initiate (buttons) + incoming-call UI + outgoing-call UI + call logs. A call button with no incoming-call handler is a dead end — the callee never sees the ring.
// Minimum calls surface — four components for voice-video-calls contract
// CometChatCallButtons: auto-rendered in the message header; place standalone when needed
val callButtons = CometChatCallButtons(context)
// CometChatOutgoingCall: shown while the callee hasn't answered yet
val outgoingCall = CometChatOutgoingCall(context)
outgoingCall.call = pendingCall
// CometChatCallActivity / CometChatOngoingCallActivity: the in-call surface, launched
// automatically during a session. ⚠️ You do NOT declare these — BOTH are already declared in the
// UI-Kit AAR manifest and merge in automatically (verified vs 6.0.x and the 6.1.1 AAR manifests). The cohort-correct classes:
// Compose: com.cometchat.uikit.compose.calls.CometChatCallActivity
// com.cometchat.uikit.compose.presentation.ongoingcall.ui.CometChatOngoingCallActivity
// Views: com.cometchat.uikit.kotlin.calls.CometChatCallActivity
// com.cometchat.uikit.kotlin.presentation.ongoingcall.ui.CometChatOngoingCallActivity
// (There is NO `com.cometchat.chatuikit.calling.*` class in v6 — that's a v5/v4-era name; do not
// add a manual <activity> line for it or the merge/launch breaks.)
// CometChatCallLogs: call history tab
val callLogs = CometChatCallLogs(context)
Huddle / docked call — Android how-to (BAKED — verified vs 6.1.1 + calls-sdk 5.0.4)
The pattern (start -> join -> dock -> indicator -> leave): cometchat-onboarding/references/clone-mode.md -> Huddle / drop-in room pattern. The Android code for both cohorts is in references/huddle.md: send the kit's own meeting message (session id = group GUID), replace the meeting bubble with a BubbleFactory so Join opens your dock, and join with CometChatCalls.joinSession(sessionId, settings, yourRelativeLayout, ...) instead of the kit's full-screen CometChatOngoingCallActivity. Compiled, not yet run on a device.
Deeper calling features → fetch
| Intent | Page (append .md) |
|---|---|
| calling overview / what's supported | /ui-kit/android/call-features |
| call buttons props | /ui-kit/android/call-buttons |
| incoming / outgoing UI props | /ui-kit/android/incoming-call · /ui-kit/android/outgoing-call |
| call logs + details recipe | /ui-kit/android/call-logs · /ui-kit/android/guide-call-log-details |
| custom in-call UI, layouts, recording, screen share, audio modes | the /calls/android/* pages (call-layouts, custom-control-panel, audio-modes, background-handling, idle-timeout, events, ...) |
Common pitfalls
Importing com.cometchat.chat.models.Call (it is com.cometchat.chat.core.Call — the wrong import compiles to an "Unresolved reference 'Call'" cascade) · manually declaring CometChatCallActivity/CometChatOngoingCallActivity in your manifest (they AUTO-MERGE from the UI-Kit AAR — a hand-written <activity> with the wrong/legacy com.cometchat.chatuikit.calling.* name breaks the launch) · Calls SDK missing (buttons never appear) · enableCalling not set in the settings file · Compose header without hideVoiceCallButton = false / hideVideoCallButton = false (buttons never appear — Compose defaults hide them) · Compose auxiliaryView used for a custom header icon (it replaces the call-button host — use trailingView) · calling enabled on an app with a persisted session without a re-login (Calls SDK tokenless — call logs silently error with "User auth token cannot be null") · no global call listener (incoming calls never ring) · listener registered per-Activity only (rings only on that screen) · registering in Application but forgetting android:name in the manifest · missing runtime CAMERA/RECORD_AUDIO permissions (call fails silently) · calling before login resolves · call UI not fitsSystemWindows / not full-bleed (controls under system bars) · leaking the listener (remove it if you register outside Application) · mixing a v4/v5 calls artifact with the v6 kit · a docked/mini call target left on the kit default (the group call button and the meeting bubble's Join both open the full-screen CometChatOngoingCallActivity; a Views CometChatOngoingCall mounted in your panel calls activity.finish() when the call ends) — dock it per references/huddle.md.
Verify it works
Compile against the pinned kit (./gradlew :app:assembleDebug # in YOUR app (npm run verify:fences:android-v6 is a pack-repo gate)). On device (TWO devices/emulators + two users — calling can't be verified single-ended): call buttons render in the message header; tapping starts an outgoing call; the OTHER device rings with the incoming UI from any screen; accept → ongoing call with audio/video; decline/cancel dismisses cleanly on both sides; the call appears in CometChatCallLogs and as a call bubble in the chat. No ring ⇒ listener not registered globally (or app not logged in). Permission denial ⇒ handle it and tell the user, don't fail silently.
04 同仓库更多 Skills
migrate-to-e2e
Moves an existing Playwright, Cypress, Selenium, Appium, Detox, Maestro, or TesterArmy suite to e2e one slice at a time, with the old suite running beside the new one until each ported test is proven. Keeps a MIGRATION.md progress file so any later session resumes where the last stopped. Optionally plants a defect to show both suites catch it. Use for /migrate-to-e2e, "migrate our tests to e2e", "port these Maestro flows", "move our TesterArmy tests", or when a project has an e2e config and an older suite still running.
e2e
Writes, runs, and debugs end-to-end tests for web and mobile apps with e2e, the agentic test runner, which mixes agent.act goals with exact locator assertions on a Playwright browser or an iOS or Android device. Also drives a project's running app live over the e2e MCP server to look at a screen, check a UI change, take a screenshot or record a video, and try a locator; and runs bug bashes, parallel e2e explore runs with each bug proven by a repro test. Use when a project depends on e2e or has an e2e.config.ts, when asked for end-to-end, browser, mobile, or agentic UI tests, to check a change in the running app, to QA or bug bash an app or branch, or when an e2e run fails.
create-verification-skill
Generate a project-local verify-<app> skill on top of e2e, so any coding agent can launch the app, check it is worth driving, exercise a feature the way a user does, keep evidence, and bug bash it. Writes the skill, a feature map with one explore charter per feature, and proves it once. Use for /create-verification-skill, "make a verification skill for this repo", or when a project has no scripted way to prove UI behavior.
deja-search
deja-vu memory — search the user's past AI coding sessions with the deja CLI. Holds what they already settled and never wrote into the repo (naming rules, banned or already-tried tools, required checks before merge, preferred values, who owns what). Use before your first edit in a task, before you call a change done or ready to merge, before you recommend a tool, library, design or reviewer, before re-debugging an error that may already be solved, when they say 'didn't we fix this before', 'what did we decide about X' or 'I already have that', and before telling them something on this machine does not exist.
deja-reflect
End-of-session reflection and memory curation with deja-vu. Review what was decided, what commands broke and what repaired them, and record durable project rules or decisions with deja remember so the next session starts with them.
revid
Make, edit, export and post AI videos with Revid (revid.ai) through the Revid MCP server. Use whenever the user wants a short-form or long-form video made (from an idea, a script, a URL, an article, a PDF, a tweet, a product page, their own clips, or a song), wants to find what is going viral on TikTok, YouTube, Instagram or X before making something, wants to edit or re-export an existing Revid project, generate a standalone AI image or clip, make a series episode, or publish and schedule a finished video to connected social accounts. Covers setup (hosted MCP with OAuth, or an API key), the 36 tools, credits, polling and the rules for publishing. Routes to the more specific revid-* skills when one fits.