/cometchat-skills:cometchat-ios-v5-sdkfrom cometchat-skills
Adds voice/video calling to iOS apps from scratch using the headless CometChat Calls SDK v5. Covers init, login, token generation, session joining, in-call actions (mute, video, layout, record, transcribe, PiP), meet-style rooms, and 1:1 ringing with Chat SDK signaling.
Ships in cometchat-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Ground truth:
CometChatCallsSDKv5 + catalogios-calls-v5.json(the closed symbol list — every type below is in it). Official docs:/calls/ios/**= v5 · Docs MCP. Fetch exactSessionSettingsfields, event names and signatures from the docs (references/docs-map.md) — never memory. ⚠️ Twelve doc pages contain symbols that DO NOT COMPILE — see "Doc corrections" below; prefer THIS skill's names over the page's. APPEND to the user's app — additive wiring only.
-core sibling, never depends on the iOS UI Kit. 1:1 ringing additionally drives the Chat SDK (CometChatSDK v4) for signaling.cometchat-ios-core + cometchat-ios-calls — not this skill."add calling from scratch / without the UI Kit", "standalone voice/video on iOS", "build my own call screen", "headless calls SDK", "meeting-room join by session id", "one-on-one ringing".
Ask whichever the request has not already settled, then WAIT. Never infer from silence — each answer means a different SDK set and a different screen.
cometchat-ios-calls. Build your own → continue here.CometChatSDK v4 for signaling (signatures: references/docs-map.md § "1:1 RINGING"), plus CometChatPushNotifications to ring while the app is backgrounded/closed.Only EXPLICIT wording settles a question — "from scratch"/"my own call screen" → 1, "ringing"/"call a user" → 2. "Add calling to my iOS app" settles NEITHER — ask both.
Swift Package Manager only — never CocoaPods, even if a Podfile exists (same rule as cometchat-ios-core: CocoaPods distribution is winding down; a Podfile is a detection signal, not an instruction). In Xcode: File → Add Package Dependencies, URL:
https://github.com/cometchat/calls-sdk-ios
⚠️ The docs print github.com/cometchat/cometchat-calls-sdk-ios — that repo 404s. Use the URL above. The package vends ONE product, CometChatCallsSDK, which bundles WebRTC as a second binary target — do not add WebRTC separately.
1:1 ringing additionally needs the Chat SDK (CometChatSDK v4) for signaling — add it as a second SPM package: URL https://github.com/cometchat/chat-sdk-ios (product CometChatSDK, rule Up to Next Major from 4.1.10, verified against 4.1.10). Without it the import CometChatSDK on the ringing path does not resolve. (Meet-style / room-only does NOT need it.)
Info.plist — REQUIRED or the call dies on first permission prompt: NSCameraUsageDescription + NSMicrophoneUsageDescription. For calls that survive backgrounding, add Background Modes → Audio, AirPlay and Picture in Picture (+ Voice over IP if you use VoIP push).
Credentials: App ID · Region · Auth Key (dev only). Fetch them through the CometChat MCP — cometchat_whoami (connected + signed in?), cometchat_list_apps (ask which EXISTING app), cometchat_get_app_credentials. Already have App ID / Region / Auth Key? Just paste them. Mint auth tokens server-side for production; never ship the Auth Key.
Init (once, must succeed) → CometChatCalls.login(...) → then generateToken / joinSession / listeners. Nothing joins before init+login resolve.
CometChatCalls.initFromSettings(onSuccess:onError:) — the ai-agent / telemetry-attributed path (persists integrationSource="ai-agent"). It takes no settings argument: it reads a physical cometchat-settings.json from Bundle.main (root appId + region; optional callsSDK → host/adminHost/clientHost/callsHost). The file MUST be in the target's Copy Bundle Resources or init fails SETTINGS_FILE_NOT_FOUND. It is intentionally undocumented (ai-agent-only) — the settings shape is baked in references/docs-map.md.CallAppSettingsBuilder().set(appID:).set(region:).build() → CometChatCalls(callsAppSettings:onSuccess:onError:). ⚠️ Use set(appID:)/set(region:) — the setAppId/setRegion/setHost spellings the docs use are deprecated in 5.0.4.initFromSettings re-attributes the app to "manual" and the ai-agent telemetry is lost.CometChatCalls.initFromSettings · CometChatCalls(callsAppSettings:) · CallAppSettingsBuilder · CometChatCalls.login (UID+authKey / UID+apiKey / authToken) · logout · getLoggedInUser → CallsUserCometChatCalls.generateToken · CometChatCalls.joinSession · CometChatCalls.sessionSettingsBuilder · SessionSettingsBuilder → SessionSettingsBuilder.SessionSettings (NESTED — that is the type joinSession(callSetting:) takes)generateToken(sessionID:) → joinSession(callToken:callSetting:container:), or joinSession(sessionID:callSetting:container:) directly.CallSession.shared, for CUSTOM controls ONLY (the default surface already renders them; see pitfall #1): leaveSession · muteAudio/unmuteAudio · pauseVideo/resumeVideo · setLayout · setAudioMode · switchCamera · raiseHand/lowerHand · startRecording/stopRecording · startTranscription/stopTranscription · startStreaming/stopStreaming · pinParticipant/unpinParticipant · muteParticipant · pauseParticipantVideo · enablePictureInPictureLayout/disablePictureInPictureLayout · isCallSessionActiveCallSession.shared, remove on teardown): SessionStatusListener · MediaEventsListener · ParticipantEventListener · LayoutListener · ButtonClickListener · clearAllListenersCallLogsBuilder → CallLogsRequest → CallLog (+ CallUser/CallGroup/CallEntity/CallStatus/CallCategory/CallDirection)AudioMode (.speaker/.earpiece/.bluetooth/.headphones) · SessionType (.video/.voice) · LayoutType (.tile/.spotlight/.sidebar) · CameraFacing (.FRONT/.REAR — UPPERCASE, the ONE Calls-SDK enum that breaks the lowercase convention; .front/.rear fail to compile, and the docs' .BACK does NOT exist — see Doc corrections)This map is a curated highlight, NOT the full surface — the AUTHORITATIVE closed list is the
ios-calls-v5.jsoncatalog (60 symbols). A symbol is real iff it's in the catalog — confirm THERE, then fetch its exact signature from the docs page inreferences/docs-map.md.
Register listeners on CallSession.shared BEFORE joining; remove each one (or clearAllListeners()) on teardown, and call CallSession.shared.leaveSession() when the screen goes away. For ringing also CometChat.removeCallListener(<id>). Never leak.
The listener contract (all five, verified in the 5.0.4 interface):
@objc and EVERY member is optional. Implement ONLY the callbacks you need — do NOT stub the rest. A name that is NOT in the protocol also compiles, then silently never fires — copy callback names from the events page / references/docs-map.md, never by analogy.@objc, the conforming type MUST be a class inheriting NSObject.CallSession.shared — the names are NOT in the catalog (it is types-only), so use these:| Protocol | Register / remove |
|---|---|
SessionStatusListener | addSessionStatusListener(_:) / removeSessionStatusListener(_:) |
MediaEventsListener | addMediaEventsListener(_:) / removeMediaEventsListener(_:) |
ParticipantEventListener | addParticipantEventListener(_:) / removeParticipantEventListener(_:) |
LayoutListener | addLayoutListener(_:) / removeLayoutListener(_:) |
ButtonClickListener | addButtonClickListener(_:) / removeButtonClickListener(_:) |
ButtonClickListener callbacks fire BEFORE the SDK's own action, and do NOT suppress it. Reacting to onLeaveSessionButtonClicked must NOT also call leaveSession() — the SDK is already leaving; doing both double-leaves.Participant has EXACTLY 12 fields, all Optional: uid · name · avatar · mid · state · isJoined · joinedAt · leftAt · deviceID · totalAudioMinutes · totalVideoMinutes · totalDurationInMinutes. Identity is uid (String? — unwrap before passing to muteParticipant(participantId:)), never name.Participant fields that DO NOT EXIST — pid, isPinned, isAudioMuted, isVideoPaused, isPresenting, raisedHandTimestamp. Copying any of them fails to compile. pid → use uid; the five state flags have no field at all — track that state yourself from the ParticipantEventListener callbacks (onParticipantAudioMuted/Unmuted, onParticipantHandRaised/Lowered, onParticipantStarted/StoppedScreenShare).// Fetch every signature/field from references/docs-map.md. This is the ORDER, which is the part that bites.
import UIKit
import CometChatCallsSDK
1. CometChatCalls.initFromSettings(onSuccess:onError:) // ai-agent default; reads bundled cometchat-settings.json
2. CometChatCalls.login(UID:authKey:onSuccess:onError:) // or login(authToken:) in production
3. let settings = CometChatCalls.sessionSettingsBuilder.setSessionType(.video).build() // NOT .setType — see Doc corrections
4. CallSession.shared.addSessionStatusListener(self) // register BEFORE joining
5. CometChatCalls.joinSession(sessionID:callSetting:container:onSuccess:onError:) // container = a UIView with REAL bounds
// or: generateToken(sessionID:) -> joinSession(callToken:callSetting:container:)
6. // NO control buttons needed — the joined surface ALREADY renders mute/video/leave.
7. // teardown -> CallSession.shared.clearAllListeners(); CallSession.shared.leaveSession()
The container MUST have real bounds — a zero-frame view renders invisibly. In SwiftUI wrap it with UIViewRepresentable.
CometChatPushNotifications)Ringing a user whose app is backgrounded or terminated is NOT the Calls SDK's job. It is
CometChatPushNotifications 1.0.0 — a different package. Do not hand-roll it.
https://github.com/cometchat/push-notifications-sdk-ios @ 1.0.0 (product
CometChatPushNotificationsSwift). Its Package.swift declares NO dependencies, yet the binary
imports CometChatSDK + CometChatCallsSDK — the app must ALSO have both packages above
(chat-sdk-ios + calls-sdk-ios) or the build fails. import CometChatPushNotificationsSwift — the
module name differs from the class name; importing CometChatPushNotifications does not compile.CometChat.init: CometChatPushNotifications.shared.initialize(config: .init(providerId:)) then set .delegateAppDelegate: forward registerDeviceToken(_:) (+ handleRegistrationFailure(_:))CometChatPushNotificationsDelegate — every method is optional; the ones that matter are presentCallScreen(for:sessionId:) and onCallCleanupComplete()PKPushRegistryDelegate or a CXProviderDelegate. The SDK owns both. Writing
either is the #1 mistake here — it fights the SDK for the same callbacks.CometChatPushNotifications.shared.notifyCallsSDKReady() from the login
success — NOT init success. It only lifts the buffer; it does not check that anyone is logged in,
so releasing at init hands presentCallScreen an unauthenticated session and the joinSession
after it fails on auth. (A 3s safety timeout fires the buffered call anyway, so a slow login can
still present early — do not assume a live session in the call screen.)presentCallScreen fires — present UI and join; do not accept again.ForegroundCallPresentation = .callKit (default) · .inApp (CometChatIncomingCallView, styled
via CometChatIncomingCallStyle) · .none (present your own).Callback shapes differ PER API and
?.on a non-optional does not compile —login/logouthand you a NON-optionalCometChatCallException;initFromSettings/generateToken/joinSessionhand you an Optional. Exact table +isCallSessionActive()arity:references/docs-map.md.
| The docs write | It does not compile — use |
|---|---|
AudioModeType (events, session-settings, recording) | AudioMode — AudioModeType exists in neither the interface nor the binary |
CometChat.CallStatus (ringing) | CometChat.callStatus — lowercase c; Swift is case-sensitive |
.setType(.video) (ringing, session-settings, join-session, idle-timeout, migration-guide) | .setSessionType(.video) — SessionSettingsBuilder has no setType in any spelling |
SPM URL .../cometchat-calls-sdk-ios (setup) | https://github.com/cometchat/calls-sdk-ios — documented URL 404s |
region is "us or eu" (setup) | also in — the SDK only checks the string is non-empty; in is a live region |
.setAppId() / .setRegion() (setup) | .set(appID:) / .set(region:) — the setX spellings are deprecated in 5.0.4 |
call.callInitiator?.name (ringing) | (call.callInitiator as? User)?.name — callInitiator/callReceiver are AppEntity?; only User has name |
CallType / CallTypeVideo as the session type (5 pages) | SessionType / SessionType.video — CallType has zero occurrences in CometChatCallsSDK. It is a Chat SDK type (CometChat.CallType), valid ONLY on the ringing path. Never pass it to SessionSettingsBuilder |
SessionType.audio for audio-only | .voice — .audio and .audioVideo are @available(*, deprecated) in 5.0.4 |
| The Objective-C tabs (setup, session-settings, ringing, voip-calling) | Do not copy them — deprecated setters, too few opening brackets, and enum constants wrongly CometChat-prefixed. Exact names: references/docs-map.md |
participant.pid / .isPinned / .isAudioMuted / .isVideoPaused / .isPresenting / .raisedHandTimestamp (actions, participant-management, custom-participant-list — 23x) | None of these exist on Participant. pid → uid; the five flags have no field — derive them from the participant events. Two review emits failed swiftc on exactly this |
CallSession.shared.setAudioMode / setLayout taking an enum | They take a String — "SPEAKER"/"EARPIECE"/"BLUETOOTH"/"HEADPHONES", "TILE"/"SPOTLIGHT"/"SIDEBAR". Only the builder forms take AudioMode / LayoutType. Same method name, two different parameter types |
docs show only login(UID:apiKey:) / login(authToken:) | login(UID:authKey:) also exists in 5.0.4 — the docs are incomplete, the skill's recipe is correct |
| — (unstated anywhere) | Chat-SDK enum casing is INCONSISTENT — CometChat.CallType/.ReceiverType Capitalised, CometChat.callStatus lowercase. Analogy fails to compile; check each. |
Docs PR cometchat/docs#489 merged 2026-09-08 and the live /calls/ios/** pages now carry these fixes — re-verified against the live pages. The one exception is CameraFacing.BACK: it is still live on both session-settings and events (.BACK, not .REAR) — #489 did not touch it (separate docs fix owed). Keep every correction above as defensive guidance. Detail + per-symbol live status: references/docs-map.md.
CallSession.shared actions are for CUSTOM controls ONLY — reach for them just when the user EXPLICITLY asks to replace the defaults, and hide the built-ins first (hide*Button list in references/docs-map.md). To merely REACT to the leave button, implement ButtonClickListener.onLeaveSessionButtonClicked — never a second button.CallSession.shared.leaveSession() ends YOUR media; CometChat.endCall(sessionID:) tells the peer and completes the call log. Do only the first and the other side still thinks the call is live.joinSession mounts into your UIView; give it real size.var window: UIWindow? on your AppDelegate, even in a scene-based app. The SDK reads UIApplication.delegate.window; without it the app aborts (unrecognized selector) right after the camera permission is granted. Detail: references/docs-map.md.NSCameraUsageDescription/NSMicrophoneUsageDescription means iOS kills the app at the first permission request.cometchat-settings.json not bundled — initFromSettings fails SETTINGS_FILE_NOT_FOUND; the file must be in Copy Bundle Resources.initFromSettings silently re-attributes telemetry to "manual".onParticipantStarted/StoppedScreenShare are real — no start/stop action (web has one), and local capture needs a Broadcast Upload Extension. Do not emit one. (The docs' onScreenShareStarted/Stopped do not exist — see docs-map.)Participant carries no mute/pin/hand/share flag, and (verified live on two clients) the participant events deliver nothing: onParticipantJoined/Left never fire and onParticipantListChanged arrives EMPTY. You can never obtain a peer uid, so muteParticipant/pinParticipant/pauseParticipantVideo have no argument. Do NOT emit them or a custom roster — the built-in participant panel is already on screen. Detail: references/docs-map.md.SessionSettings fields and action params are FETCHED from docs, never guessed.CometChatCallsSDK symbol emitted appears in ios-calls-v5.json (node test-suite/scripts/verify-catalog.mjs --family ios-calls-v5).CometChatCallsSDK (5.0.4) with swiftc -typecheck.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
cometchat, webrtc, voice-calling, video-calling, ios-sdk, swift-package-manager
npx claudepluginhub cometchat/cometchat-skills --plugin cometchat-skills98 skills in this plugin
/cometchatEntry point for any CometChat task on any platform. Detects the framework + UI Kit version (React, Angular, iOS, Android, React Native, Flutter), then routes to that family's skills — for a NEW integration or a change to an existing one. Triggers: 'add chat', 'add cometchat', 'add chat to my app', 'add calling', 'change something in my chat', 'my chat is already set up', 'add a feature to the chat', 'add chat to my android app', 'integrate cometchat android', 'add chat to my ios app', 'integrate cometchat ios', 'add chat to my swift app', 'migrate my app to cometchat', 'migrate from sendbird', 'migrate from getstream / stream', 'replace sendbird / stream chat with cometchat', 'build a <app> clone', 'make a chat app like <app>', 'make it look and work like <app>'./cometchat-a11yKeep a CometChat integration accessible — the UI Kit is designed targeting WCAG 2.1 AA with keyboard navigation (verify per component in its docs; full conformance still needs manual testing), and this skill makes sure the HOST app doesn't break that, covering contrast, focus, screen-reader context, reduced motion, RTL, and calls accessibility. Cross-family. Triggers: 'is cometchat accessible', 'WCAG / 508 / ADA compliance', 'screen reader support', 'keyboard navigation', 'a11y audit', 'accessible chat', 'contrast/focus issues in chat'./cometchat-analyticsSee what your chat is doing — pull usage & message metrics via REST, stream real-time events to your data/observability stack via webhooks, monitor client-side errors & the init/login path, and read push/call logs. Cross-family: metrics/webhooks are server-side; client error monitoring wires per family. Triggers: 'chat analytics', 'usage metrics', 'message volume', 'monitor cometchat', 'observability', 'send chat events to datadog/segment/bigquery', 'track delivery', 'error monitoring for chat', 'dashboards for chat'./cometchat-android-v5-calls-sdkAdd voice & video calling to any Android app FROM SCRATCH with the headless CometChat Calls SDK v5 (`com.cometchat:calls-sdk-android:5.0.4`) — no UI Kit. Kotlin: initFromSettings→login→generateToken→joinSession into a RelativeLayout, lifecycle-bound listeners, meet-style session rooms AND 1:1 ringing (Chat SDK v5 signaling + Calls SDK media), call logs, layouts, audio modes, recording, PiP, background service. Triggers: 'add calling from scratch android', 'standalone video call kotlin', 'headless calls sdk android', 'build my own call UI android', 'meeting room join by session id android', 'one-on-one ringing call without uikit android'./cometchat-android-v5-sdkBuild chat on Android with the headless CometChat Chat SDK v5 and your OWN UI — init/login ordering, the method map, request-builder pagination, listener lifecycle, and a production-ready app surface (optimistic updates, error states, sized shell). Use when the app needs custom UI instead of the drop-in UI Kit. Triggers: 'cometchat android sdk', 'chat with my own ui android', 'headless cometchat android', 'send message with chat-sdk-android', 'cometchat message listener kotlin'./cometchat-android-v6-builder-settingsThe CometChat Android v6 settings and session API reference — the assets/cometchat-settings.json file that initFromSettings reads (appId, region, credentials, uiKit toggles), the legacy UIKitSettings builder, and the CometChatUIKit session methods (login, loginWithAuthToken, logout, getLoggedInUser, createUser). Use when configuring init options or wiring auth beyond the core golden path. Triggers: 'cometchat settings json android', 'uikitsettings builder options', 'login with auth token android', 'create a cometchat user from the app', 'enable calling in settings'.Other plugins' skills for the same job