@cometchat/skills 4.4.1 → 4.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -9
- package/package.json +2 -2
- package/skills/cometchat/SKILL.md +1 -1
- package/skills/cometchat-android-v5-calls/SKILL.md +3 -1
- package/skills/cometchat-android-v6-calls/SKILL.md +3 -1
- package/skills/cometchat-android-v6-core/SKILL.md +1 -1
- package/skills/cometchat-angular-calls/SKILL.md +2 -0
- package/skills/cometchat-angular-core/SKILL.md +1 -1
- package/skills/cometchat-calls/SKILL.md +1 -1
- package/skills/cometchat-core/SKILL.md +1 -1
- package/skills/cometchat-flutter-v5-calls/SKILL.md +6 -4
- package/skills/cometchat-flutter-v6-calls/SKILL.md +4 -2
- package/skills/cometchat-flutter-v6-core/SKILL.md +1 -1
- package/skills/cometchat-ios-calls/SKILL.md +65 -20
- package/skills/cometchat-ios-calls/references/add-calls-to-existing-chat.md +12 -5
- package/skills/cometchat-ios-core/SKILL.md +1 -1
- package/skills/cometchat-native-calls/SKILL.md +3 -1
- package/skills/cometchat-native-core/SKILL.md +1 -1
- package/skills/cometchat-react-calls/SKILL.md +5 -2
- package/LICENSE +0 -21
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# cometchat-skills
|
|
2
2
|
|
|
3
|
-
**Add CometChat to any React, React Native, Angular, Android, Flutter, or iOS project through your AI coding agent.** Works with Claude Code, Cursor, Codex, VS Code Copilot, Windsurf, Cline, Kiro, and [
|
|
3
|
+
**Add CometChat to any React, React Native, Angular, Android, Flutter, or iOS project through your AI coding agent.** Works with Claude Code, Cursor, Codex, VS Code Copilot, Windsurf, Cline, Kiro, and [50+ more agents](https://github.com/vercel-labs/skills).
|
|
4
4
|
|
|
5
5
|
v4 takes an AI-first approach: your agent has a short conversation with you to understand your project and chat requirements, then writes production-grade integration code tailored to the files you already have. One slash — `/cometchat` — works for every supported framework, on web, mobile, and native.
|
|
6
6
|
|
|
@@ -17,9 +17,9 @@ Override detection if needed:
|
|
|
17
17
|
```bash
|
|
18
18
|
npx @cometchat/skills add --family web # React / Next.js / React Router / Astro
|
|
19
19
|
npx @cometchat/skills add --family native # Expo / bare RN
|
|
20
|
-
npx @cometchat/skills add --family angular # Angular
|
|
21
|
-
npx @cometchat/skills add --family android # Native Android (
|
|
22
|
-
npx @cometchat/skills add --family flutter # Flutter (
|
|
20
|
+
npx @cometchat/skills add --family angular # Angular 17-21
|
|
21
|
+
npx @cometchat/skills add --family android # Native Android (V6 stable, recommended + V5 legacy)
|
|
22
|
+
npx @cometchat/skills add --family flutter # Flutter (V6 stable, recommended + V5 legacy)
|
|
23
23
|
npx @cometchat/skills add --family ios # Native iOS (V5 stable)
|
|
24
24
|
npx @cometchat/skills add --family all # install every published skill
|
|
25
25
|
```
|
|
@@ -83,7 +83,7 @@ Or add voice & video calling (new in v4.2):
|
|
|
83
83
|
When integrating chat, the dispatcher now asks **how** you want to customize (new in v4.3):
|
|
84
84
|
|
|
85
85
|
```
|
|
86
|
-
◉ Visually —
|
|
86
|
+
◉ Visually — enable-disable in browser
|
|
87
87
|
○ In code — code-driven defaults
|
|
88
88
|
```
|
|
89
89
|
|
|
@@ -110,10 +110,10 @@ No templates, no experiences to pick — the agent writes real code that fits yo
|
|
|
110
110
|
| Astro (React islands) | ✅ | ✅ Ringing + Session | ✅ (v4.3) |
|
|
111
111
|
| Expo (managed + Expo Router) | ✅ | ✅ Ringing + Session | ✅ (v4.3) |
|
|
112
112
|
| Bare React Native (CLI) | ✅ | ✅ Ringing + Session | ✅ (v4.3) |
|
|
113
|
-
| Angular
|
|
114
|
-
| Android (
|
|
115
|
-
| Flutter (
|
|
116
|
-
| iOS (V5 stable) | ✅ | ✅ Ringing + Session |
|
|
113
|
+
| Angular 17-21 | ✅ | ✅ Ringing + Session | ❌ (auto-falls back to In code) |
|
|
114
|
+
| Android (V6 stable, recommended + V5 legacy) | ✅ | ✅ Ringing + Session | ✅ V6 (v4.3) |
|
|
115
|
+
| Flutter (V6 stable, recommended + V5 legacy) | ✅ | ✅ Ringing + Session | ✅ V6 chat-only (v4.3) |
|
|
116
|
+
| iOS (V5 stable) | ✅ | ✅ Ringing + Session | ✅ (v4.4) |
|
|
117
117
|
|
|
118
118
|
**Calling modes:**
|
|
119
119
|
- **Ringing** — kit-driven incoming/outgoing call surfaces, system-level VoIP push (CallKit on iOS, ConnectionService on Android, web push fallback on browsers). Production-grade for 1:1 + group calls.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cometchat/skills",
|
|
3
|
-
"version": "4.4.
|
|
3
|
+
"version": "4.4.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"kotlin",
|
|
27
27
|
"ui-kit"
|
|
28
28
|
],
|
|
29
|
-
"author": "
|
|
29
|
+
"author": "CometChat",
|
|
30
30
|
"license": "MIT",
|
|
31
31
|
"repository": {
|
|
32
32
|
"type": "git",
|
|
@@ -499,7 +499,7 @@ Field meanings (from the dashboard's signup screens):
|
|
|
499
499
|
- **Step 3a:** if `meta.intent === "exploring"`, skip the placement-intent question and route straight to the "Just exploring" branch (one route/screen with `<CometChatConversations />` and `cometchat-uid-1` pre-logged-in).
|
|
500
500
|
- **Step 3b.1 (industry tailoring):** use `last_app.industry` to layer industry-specific upsells onto the placement recommendation — moderation features for dating apps, HIPAA-aware production patterns for healthcare, link-preview for marketplaces, etc. Augment, don't replace.
|
|
501
501
|
- **Step 5 explanations:** if `meta.role === "frontend"`, lead with concrete component composition + CSS examples; if `meta.role === "engineering_leader/manager"`, lead with placement architecture trade-offs (where state lives, what gets cached, how routing fits the project's pattern).
|
|
502
|
-
- **Greeting:** if `meta.name` is non-null, greet by name in any user-facing message during the rest of the flow ("Got it,
|
|
502
|
+
- **Greeting:** if `meta.name` is non-null, greet by name in any user-facing message during the rest of the flow ("Got it, {name} — let's pick an app").
|
|
503
503
|
|
|
504
504
|
**Failure modes — each is non-blocking; degrade to the original generic flow:**
|
|
505
505
|
|
|
@@ -324,13 +324,15 @@ Component-level deep dives: `references/audio-controls.md`, `references/video-co
|
|
|
324
324
|
|
|
325
325
|
When `product === "voice-video"` and there is no existing chat integration.
|
|
326
326
|
|
|
327
|
+
> **Telemetry attribution (`ai-agent`).** Session mode (§4a, Calls SDK only) MUST init via `CometChatCalls.initFromSettings(context, callback)` (`com.cometchat:calls-sdk-android >= 5.0.2`, verified via `javap`) reading `app/src/main/assets/cometchat-settings.json` — it's the only reporter in a calls-only app and fires on `CometChatCalls.login`. **Additive** mode (calls added on top of a v5 chat integration) is attributed by the chat side when chat inits via `CometChatUIKit.initFromSettings` (`cometchat-android-v5-core`); the additive calls step adds a raw `CometChatCalls.init`, which the SDK suppresses in favour of the chat report. **Ringing mode (§4b)** links the raw Chat SDK for signaling — use `CometChatCalls.initFromSettings` there too so the calls side carries the flag.
|
|
328
|
+
|
|
327
329
|
**Split by calling mode:**
|
|
328
330
|
|
|
329
331
|
### 4a. Standalone — Session mode (meeting-room UX, no ringing)
|
|
330
332
|
|
|
331
333
|
Calls SDK ONLY. NO Chat SDK, NO ConnectionService, NO FCM-for-VoIP. Matches `calls-sdk-android-5/samples/sample-app/`. Scaffold:
|
|
332
334
|
|
|
333
|
-
1. **`Application` class** — `CometChatCalls.init(...)`
|
|
335
|
+
1. **`Application` class** — **`CometChatCalls.initFromSettings(context, callback)`** ONLY in `onCreate`, reading the committed `app/src/main/assets/cometchat-settings.json` so the calls-only app self-reports `integrationSource = "ai-agent"` (`calls-sdk-android >= 5.0.2`; on an older SDK the method is absent — fall back to the `CallAppSettings.CallAppSettingBuilder` + `CometChatCalls.init(...)` shown in §2). No `CometChat.init`, no PhoneAccount, no ConnectionService. The report fires on `CometChatCalls.login(uid, authKey, callback)` success, so log the user in via `CometChatCalls.login` in session mode.
|
|
334
336
|
2. **`JoinSessionActivity`** — UID picker + Start/Join meeting + state.
|
|
335
337
|
3. **`CallActivity`** — Single-call `CometChatCalls.joinSession(sessionId, sessionSettings, container, CallbackListener)`. `SessionStatusListener` + `ButtonClickListener` registered on the `CallSession` from `onSuccess`. `CometChatOngoingCallService.launch/abort`. See `references/call-session.md`.
|
|
336
338
|
4. **`AndroidManifest.xml`** — Camera + microphone permissions + `FOREGROUND_SERVICE_MICROPHONE/CAMERA` + `CometChatOngoingCallService` registration. NO ConnectionService.
|
|
@@ -369,13 +369,15 @@ Full component-by-component catalogs live in the existing `cometchat-android-v6-
|
|
|
369
369
|
|
|
370
370
|
When `product === "voice-video"` and there is no V6 chat integration yet.
|
|
371
371
|
|
|
372
|
+
> **Telemetry attribution (`ai-agent`).** Session mode (§4a, Calls SDK only) MUST init via `CometChatCalls.initFromSettings(context, callback)` (`com.cometchat:calls-sdk-android >= 5.0.2`, verified via `javap`) reading `app/src/main/assets/cometchat-settings.json` — the only reporter in a calls-only app; fires on `CometChatCalls.login`. **Additive mode:** no calling-enable field is needed — `integrationSource = "ai-agent"` is persisted (appId-scoped) by the chat-side `CometChatUIKit.initFromSettings` (`cometchat-android-v6-core`), and the calls integration is attributed at the backend from the **calls SDK version + platform present in the `/user_sessions` node**. Enabling calls via `setEnableCalling(true)` on the builder does not affect either signal.
|
|
373
|
+
|
|
372
374
|
**Split by calling mode:**
|
|
373
375
|
|
|
374
376
|
### 4a. Standalone — Session mode (meeting-room UX, no ringing)
|
|
375
377
|
|
|
376
378
|
Calls SDK ONLY. NO chatuikit-android, NO ConnectionService, NO FCM-for-VoIP. Same SDK as V5 (`com.cometchat.calls-sdk-android`). Scaffold:
|
|
377
379
|
|
|
378
|
-
1. **`Application` class** — `CometChatCalls.init(...)`
|
|
380
|
+
1. **`Application` class** — **`CometChatCalls.initFromSettings(context, callback)`** ONLY, reading the committed `app/src/main/assets/cometchat-settings.json` so the calls-only app self-reports `integrationSource = "ai-agent"` (`calls-sdk-android >= 5.0.2`; older SDK → fall back to `CallAppSettings.CallAppSettingBuilder` + `CometChatCalls.init(...)`). No chatuikit, no Chat SDK init. The report fires on `CometChatCalls.login` success.
|
|
379
381
|
2. **`MainActivity` (Compose)** — `setContent` with `NavHost` for `/`, `/meet/{sessionId}`.
|
|
380
382
|
3. **`CallRoom` composable** — `AndroidView` factory wrapping `RelativeLayout` (remember-stable), `LaunchedEffect(sessionId)` fires `CometChatCalls.joinSession(sessionId, settings, container, CallbackListener)`, `DisposableEffect` cleanup. See `references/call-session.md`.
|
|
381
383
|
4. **`AndroidManifest.xml`** — Camera + microphone permissions + `FOREGROUND_SERVICE_MICROPHONE/CAMERA` + `CometChatOngoingCallService` registration. NO ConnectionService.
|
|
@@ -235,7 +235,7 @@ Initialize once in your `Application` class or splash screen — never in every
|
|
|
235
235
|
}
|
|
236
236
|
```
|
|
237
237
|
|
|
238
|
-
>
|
|
238
|
+
> **Commit `cometchat-settings.json` — do not gitignore it** (the file is part of the integration). Its `authKey` is an **optional demo/POC credential**: a quick-start affordance so a PM or developer can see working chat *before* the backend auth-token flow is wired (that flow often waits on internal approvals). Because the file is committed to source control, treat the key as public — use a **dedicated demo CometChat app** (a committed key trips secret scanners and stays in git history; never reuse a production app's key). Switch to a server-minted `authToken` via `loginWithAuthToken()` before production, where `authKey` must not ship.
|
|
239
239
|
|
|
240
240
|
**Step 2 — init in `Application.onCreate()`.** No `UIKitSettingsBuilder` — the SDK reads `app/src/main/assets/cometchat-settings.json` itself:
|
|
241
241
|
|
|
@@ -54,6 +54,8 @@ await CometChatUIKit.init(settings);
|
|
|
54
54
|
await CometChatUIKit.login("cometchat-uid-1"); // kit initializes the Calls SDK internally
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
+
> **Telemetry (`ai-agent`).** Enabling calls uses `setCallingEnabled(true)` on the builder — no calling-enable field in `cometchat-settings.json` is needed. `integrationSource = "ai-agent"` is persisted (appId-scoped) by the chat-side `CometChatUIKit.initFromSettings` (`cometchat-angular-core`) and reported on chat login; the calls integration is attributed at the backend from the **calls SDK version + platform present in the `/user_sessions` node**. Both signals are already captured — nothing extra to wire here.
|
|
58
|
+
|
|
57
59
|
- `setCallingEnabled(true)` is a real `UIKitSettingsBuilder` method (verified in the kit `.d.ts`). It is **off by default** — without it the call components render disabled and `CometChatUIKit.isCallingEnabled()` returns `false`.
|
|
58
60
|
- After login, confirm with `CometChatUIKit.isCallingEnabled()` (static, returns `boolean`) before rendering call UI on a custom screen.
|
|
59
61
|
- **Optional advanced config:** to override the Calls SDK app settings, build a `CometChatUIKitCalls.CallAppSettingsBuilder()` and pass it via `.setCallAppSettings(callAppSettings)`. `CometChatUIKitCalls` is re-exported by the UI Kit — import it from `@cometchat/chat-uikit-angular` (the kit wraps the optional `@cometchat/calls-sdk-javascript` dependency; the calls SDK itself exports `CometChatCalls`, not `CometChatUIKitCalls`):
|
|
@@ -123,7 +123,7 @@ CometChatUIKit.initFromSettings(cometchatSettings)
|
|
|
123
123
|
.catch((err) => console.error("CometChat init failed:", err));
|
|
124
124
|
```
|
|
125
125
|
|
|
126
|
-
- **
|
|
126
|
+
- **Commit `cometchat-settings.json` — do not gitignore it** (the file is part of the integration). Its `authKey` is an **optional demo/POC credential**: a quick-start affordance so a PM or developer can see working chat *before* the backend auth-token flow is wired (that flow often waits on internal approvals). Because the file is committed to source control, treat the key as public — use a **dedicated demo CometChat app** (a committed key trips secret scanners and stays in git history; never reuse a production app's key). Switch to a server-minted `authToken` via `loginWithAuthToken` before production, where `authKey` must not ship.
|
|
127
127
|
|
|
128
128
|
### UIKitSettingsBuilder — the init pattern (fallback — published kit; reports `manual`)
|
|
129
129
|
|
|
@@ -42,7 +42,7 @@ The chat dispatcher (`cometchat/SKILL.md`) assumes the user is adding a chat sur
|
|
|
42
42
|
| Concern | Chat dispatcher | Calls dispatcher (this skill) |
|
|
43
43
|
|---|---|---|
|
|
44
44
|
| Packages | `chat-uikit-*` + `chat-sdk-*` | `chat-sdk-*` + `calls-sdk-*` (no UI Kit in standalone mode) |
|
|
45
|
-
| Init | Chat SDK init + login | Chat SDK init + login + Calls SDK
|
|
45
|
+
| Init | Chat SDK init + login | Chat SDK init + login + Calls SDK init (the dual-SDK contract; on iOS ≥5.0.2 prefer file-based `CometChatCalls.initFromSettings` reading `cometchat-settings.json` — ai-agent telemetry attribution — over the raw `CallAppSettings` builder; see `cometchat-ios-calls` §2) |
|
|
46
46
|
| Placement question | "Where does **chat** live?" | "Where does the **call trigger** live?" + "Where do call logs live?" |
|
|
47
47
|
| Components | Conversations, MessageList, Composer, Users, Groups | CallButtons, IncomingCall, OutgoingCall, OngoingCall, CallLogs |
|
|
48
48
|
| `IncomingCall` mount | At chat surface (rings while user is chatting) | **At app root** — always-rendering, listens app-wide |
|
|
@@ -118,7 +118,7 @@ import cometchatSettings from "./cometchat-settings.json"; // adjust path to the
|
|
|
118
118
|
await CometChatUIKit.initFromSettings(cometchatSettings);
|
|
119
119
|
```
|
|
120
120
|
|
|
121
|
-
- **
|
|
121
|
+
- **Commit `cometchat-settings.json` — do not gitignore it** (the file is part of the integration). Its `authKey` is an **optional demo/POC credential**: a quick-start affordance so a PM or developer can see working chat *before* the backend auth-token flow is wired (that flow often waits on internal approvals). Because the file is committed to source control, treat the key as public — use a **dedicated demo CometChat app** (a committed key trips secret scanners and stays in git history; never reuse a production app's key). Switch to a server-minted `authToken` via `loginWithAuthToken` before production, where `authKey` must not ship.
|
|
122
122
|
- The same module-flag / `useEffect` / entry-point placement rules in the rest of this section apply unchanged — just swap `CometChatUIKit.init(settings)` for `CometChatUIKit.initFromSettings(cometchatSettings)`.
|
|
123
123
|
|
|
124
124
|
### The UIKitSettingsBuilder (fallback — UI Kit before file-based init)
|
|
@@ -261,7 +261,7 @@ dependencies:
|
|
|
261
261
|
flutter:
|
|
262
262
|
sdk: flutter
|
|
263
263
|
cometchat_chat_uikit: ^5.2.14 # additive mode — existing GetX chat kit (keep)
|
|
264
|
-
cometchat_calls_sdk: ^5.0.
|
|
264
|
+
cometchat_calls_sdk: ^5.0.4 # DIRECT dependency — 5.x calls SDK (raw); >=5.0.4 ships initFromSettings
|
|
265
265
|
permission_handler: ^11.0.0 # rule 1.6
|
|
266
266
|
flutter_callkit_incoming: ^2.0.0 # standalone — VoIP UI bridge
|
|
267
267
|
firebase_messaging: ^14.0.0 # standalone — Android FCM
|
|
@@ -366,14 +366,16 @@ You build the call surface yourself (custom widgets) around these APIs. There ar
|
|
|
366
366
|
|
|
367
367
|
When `product === "voice-video"` and there is no v5 chat integration.
|
|
368
368
|
|
|
369
|
+
> **Telemetry attribution (`ai-agent`).** Session mode (§4a) MUST init the calls SDK via `CometChatCalls.initFromSettings(onSuccess:, onError:)` (`cometchat_calls_sdk >= 5.0.4`, verified against `lib/src/plugin/cometchatcalls.dart`) reading the `cometchat-settings.json` asset — it persists the `ai-agent` source and the report fires on `CometChatCalls.loginWithAuthToken`/`login`. **Additive** mode (raw calls SDK added to a v5 chat integration) is attributed by the chat side when chat inits via `CometChatUIKit.initFromSettings` (`cometchat-flutter-v5-core`). Pin `cometchat_calls_sdk: ^5.0.4` — the floor that ships `initFromSettings`.
|
|
370
|
+
|
|
369
371
|
**Split by calling mode:**
|
|
370
372
|
|
|
371
373
|
### 4a. Standalone — Session mode (meeting-room UX, no ringing)
|
|
372
374
|
|
|
373
375
|
5.x Calls SDK ONLY. The Chat SDK is present only as the source of the auth token used to log the Calls SDK in (rule 1.0). Scaffold:
|
|
374
376
|
|
|
375
|
-
1. **`pubspec.yaml`** — `cometchat_calls_sdk: ^5.0.
|
|
376
|
-
2. **`lib/main.dart`** — `CometChat.init(...)` + `CometChat.login(...)
|
|
377
|
+
1. **`pubspec.yaml`** — `cometchat_calls_sdk: ^5.0.4` (the floor that ships `initFromSettings`) + `cometchat_chat_sdk` (for the auth token). No `cometchat_chat_uikit`, no `cometchat_calls_uikit`. Declare `cometchat-settings.json` under `flutter: assets:`.
|
|
378
|
+
2. **`lib/main.dart`** — `CometChat.init(...)` + `CometChat.login(...)` (Chat SDK only mints the auth token), then **`CometChatCalls.initFromSettings(onSuccess:, onError:)`** reading the committed `cometchat-settings.json` asset so the calls app self-reports `integrationSource = "ai-agent"` (on `<= 5.0.3` the method is absent — fall back to `CometChatCalls.init(callAppSettings, onSuccess:, onError:)` built via `CallAppSettingBuilder()..appId=…..region=…`) + `CometChatCalls.loginWithAuthToken(authToken: ..., ...)` (the login that fires the report) + `permission_handler` flow.
|
|
377
379
|
3. **`lib/screens/call_screen.dart`** — `StatefulWidget` implementing the relevant 5.x split listeners (`SessionStatusListeners`, etc.). `CometChatCalls.joinSession(sessionId: ..., sessionSettings: SessionSettingsBuilder().build(), onSuccess:, onError:)`. Register listeners on `CallSession.getInstance()` in `onSuccess`. `CometChatOngoingCallService.launch/abort`. See `references/call-session.md`.
|
|
378
380
|
4. **Native config** — Camera + microphone permissions only (no PushKit, no FCM for VoIP).
|
|
379
381
|
|
|
@@ -395,7 +397,7 @@ Dual-SDK: Chat SDK signaling + 5.x Calls SDK media. Scaffold:
|
|
|
395
397
|
|
|
396
398
|
When chat is already integrated (existing GetX `cometchat_chat_uikit`). The skill:
|
|
397
399
|
|
|
398
|
-
1. Adds **`cometchat_calls_sdk: ^5.0.
|
|
400
|
+
1. Adds **`cometchat_calls_sdk: ^5.0.4`** (raw, direct) to `pubspec.yaml` — NOT `cometchat_calls_uikit`.
|
|
399
401
|
2. Inits + logs in the 5.x Calls SDK alongside the existing chat init/login (rules 1.0, 1.1).
|
|
400
402
|
3. Sets a plain `GlobalKey<NavigatorState>` on `MaterialApp.navigatorKey` (rule 1.7).
|
|
401
403
|
4. Mounts the global Chat SDK `CallListener` in the app-shell `State` (rule 1.7).
|
|
@@ -320,14 +320,16 @@ Pass to `UIKitSettings.callingConfiguration` to apply globally without per-compo
|
|
|
320
320
|
|
|
321
321
|
When `product === "voice-video"` and there is no v6 chat integration.
|
|
322
322
|
|
|
323
|
+
> **Telemetry attribution (`ai-agent`).** Session mode (§4a, Calls SDK only) MUST init via `CometChatCalls.initFromSettings(onSuccess:, onError:)` (`cometchat_calls_sdk >= 5.0.4`, verified against `lib/src/plugin/cometchatcalls.dart`) reading the `cometchat-settings.json` asset — the only reporter in a calls-only app; fires on `CometChatCalls.login`. **Additive mode:** no calling-enable field is needed — `integrationSource = "ai-agent"` is persisted (appId-scoped) by the chat-side `CometChatUIKit.initFromSettings` (`cometchat-flutter-v6-core`), and the calls integration is attributed at the backend from the **calls SDK version + platform present in the `/user_sessions` node**. Enabling calls via `..enableCalls = true` + `CometChatUIKitCalls.init()` does not affect either signal.
|
|
324
|
+
|
|
323
325
|
**Split by calling mode:**
|
|
324
326
|
|
|
325
327
|
### 4a. Standalone — Session mode (meeting-room UX, no ringing)
|
|
326
328
|
|
|
327
329
|
Calls SDK ONLY. NO Chat SDK, NO UIKit. Same SDK as v5 (`cometchat_calls_sdk`). Scaffold:
|
|
328
330
|
|
|
329
|
-
1. **`pubspec.yaml`** — `cometchat_calls_sdk: ^5.0.
|
|
330
|
-
2. **`lib/main.dart`** — `CometChatCalls.init((CallAppSettingBuilder()..appId = APP_ID..region = REGION).build(), onSuccess
|
|
331
|
+
1. **`pubspec.yaml`** — `cometchat_calls_sdk: ^5.0.4` (the floor that ships `initFromSettings`) + `flutter_bloc` + `equatable` + `permission_handler`. Declare `cometchat-settings.json` under `flutter: assets:`.
|
|
332
|
+
2. **`lib/main.dart`** — **`CometChatCalls.initFromSettings(onSuccess: ..., onError: ...)`** reading the committed `cometchat-settings.json` asset so the calls-only app self-reports `integrationSource = "ai-agent"` (`cometchat_calls_sdk >= 5.0.4`, verified against `src/plugin/cometchatcalls.dart`; on `<= 5.0.3` fall back to `CometChatCalls.init((CallAppSettingBuilder()..appId = APP_ID..region = REGION).build(), onSuccess:, onError:)` — `CallAppSettingBuilder` exposes only `appId`/`region`/host overrides, no `authKey`). Permission requests. NO Chat SDK init. The report fires on `CometChatCalls.login` success.
|
|
331
333
|
3. **`lib/cubits/call_session_cubit.dart`** — Cubit implements `SessionStatusListeners`. `CometChatCalls.joinSession(sessionId:, sessionSettings: SessionSettingsBuilder().build(), onSuccess:, onError:)`. Renders the returned `Widget?` via `SizedBox.expand`. See `references/call-session.md`.
|
|
332
334
|
4. **`lib/screens/call_room.dart`** — `BlocConsumer` for auto-pop on idle transition.
|
|
333
335
|
5. **Native config** — Camera + microphone permissions only.
|
|
@@ -70,7 +70,7 @@ flutter:
|
|
|
70
70
|
- cometchat-settings.json
|
|
71
71
|
```
|
|
72
72
|
|
|
73
|
-
- **
|
|
73
|
+
- **Commit `cometchat-settings.json` — do not gitignore it** (the file is part of the integration). Its `authKey` is an **optional demo/POC credential**: a quick-start affordance so a PM or developer can see working chat *before* the backend auth-token flow is wired (that flow often waits on internal approvals). Because the file is committed to source control, treat the key as public — use a **dedicated demo CometChat app** (a committed key trips secret scanners and stays in git history; never reuse a production app's key). Switch to a server-minted `authToken` via `loginWithAuthToken` before production, where `authKey` must not ship.
|
|
74
74
|
|
|
75
75
|
**Step 3 — init in `main()`.** No `UIKitSettingsBuilder`, no config const — the SDK reads `cometchat-settings.json` itself:
|
|
76
76
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: cometchat-ios-calls
|
|
3
|
-
description: CometChat Calls SDK v5 integration for native iOS (Swift; SwiftUI + UIKit hosting). Covers SDK install (SPM + CocoaPods),
|
|
3
|
+
description: CometChat Calls SDK v5 integration for native iOS (Swift; SwiftUI + UIKit hosting). Covers SDK install (SPM + CocoaPods), file-based init via cometchat-settings.json (CometChatCalls.initFromSettings, ai-agent telemetry) with builder fallback, dual-SDK ringing (Chat SDK initiateCall + Calls SDK generateToken/startSession), CallKit + PushKit VoIP push, AVAudioSession routing, mixed-stack hosting (UIViewControllerRepresentable for SwiftUI), Info.plist permissions + Background Modes, and additive-vs-standalone modes.
|
|
4
4
|
license: "MIT"
|
|
5
|
-
compatibility: "Xcode 15+, Swift 5.9+, iOS
|
|
5
|
+
compatibility: "Xcode 15+, Swift 5.9+, iOS 15.1+ deployment target (CometChatCallsSDK 5.0.2+; 13.0 only for <= 5.0.1); CometChatSDK 4.x; CometChatUIKitSwift 5.x (additive mode)"
|
|
6
6
|
metadata:
|
|
7
7
|
author: "CometChat"
|
|
8
|
-
version: "4.
|
|
8
|
+
version: "4.1.0"
|
|
9
9
|
tags: "cometchat ios calls voice video webrtc swift swiftui uikit callkit pushkit avaudiosession spm cocoapods voip background-modes"
|
|
10
10
|
---
|
|
11
11
|
|
|
@@ -40,11 +40,13 @@ Production-grade voice + video calling for native iOS. Loaded by `cometchat-call
|
|
|
40
40
|
|
|
41
41
|
## 1. The seven hard rules — iOS specialization
|
|
42
42
|
|
|
43
|
-
> ⚠️ **TOP PRIORITY (ENG-35710): Auth-token passing is the most-broken step on iOS Calls integrations.** Unlike Android / Flutter / JS, the **iOS Calls SDK 5.x has NO separate login step** — there is no `CometChatCalls.login(...)` and no `CometChatCalls.getLoggedInUser()` (those are phantom; verified absent from `CometChatCallsSDK`). Auth is supplied **per session** as the `authToken:` argument to `CometChatCalls.generateToken(authToken:sessionID:)`. Every tester who hit "calls don't work" on iOS traced back to that token: (a) the token was empty/nil → `generateToken` fails with **"auth token cannot be null"**; (b) a server-minted token expired between mint and `generateToken` (default ~30-minute TTL); (c) the client-side `apiKey` was passed instead of the user's auth token. Before scaffolding ANY iOS calls code, confirm the auth path (dev: read `CometChat.getUserAuthToken()`; production: fetch a fresh server-minted token) and feed it to `generateToken`. Mixing them is the canonical "ringing but never joins" iOS failure mode.
|
|
43
|
+
> ⚠️ **TOP PRIORITY (ENG-35710): Auth-token passing is the most-broken step on iOS Calls integrations.** Unlike Android / Flutter / JS, the **iOS Calls SDK 5.x has NO separate login step** — there is no `CometChatCalls.login(...)` and no `CometChatCalls.getLoggedInUser()` (those are phantom; verified absent from `CometChatCallsSDK` — **in 5.0.1 and earlier; 5.0.2 restores them — see the §1.0 correction**). Auth is supplied **per session** as the `authToken:` argument to `CometChatCalls.generateToken(authToken:sessionID:)`. Every tester who hit "calls don't work" on iOS traced back to that token: (a) the token was empty/nil → `generateToken` fails with **"auth token cannot be null"**; (b) a server-minted token expired between mint and `generateToken` (default ~30-minute TTL); (c) the client-side `apiKey` was passed instead of the user's auth token. Before scaffolding ANY iOS calls code, confirm the auth path (dev: read `CometChat.getUserAuthToken()`; production: fetch a fresh server-minted token) and feed it to `generateToken`. Mixing them is the canonical "ringing but never joins" iOS failure mode.
|
|
44
44
|
|
|
45
|
-
### 1.0 The iOS Calls SDK has NO separate login (v5)
|
|
45
|
+
### 1.0 The iOS Calls SDK has NO separate login (v5) — CORRECTED for 5.0.2 (2026-07-21)
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
> **Correction (ENG-37137, verified against the published 5.0.2 binary + live end-to-end test 2026-07-21):** the "no login" claim below is TRUE for the UI Kit-vendored calls framework and for standalone **5.0.1 and earlier**, but **standalone `CometChatCallsSDK` 5.0.2 exports `login(UID:authKey:)` / `login(UID:apiKey:)` / `login(authToken:)` / `logout()` and persists the session** (v4-compat surface restored in `calls-core`; the SDK's own sample app logs in via `LoginViewController`). This matters for two reasons: (a) after login, the `generateToken(sessionID:)` overload works without hand-passing an auth token; (b) **login success is the trigger for the ai-agent identification telemetry** (§2) — in a calls-only app that never logs in, the self-report has nothing to fire on. Dual-SDK (ringing) integrations are unaffected: the Chat SDK login remains the only login you need there.
|
|
48
|
+
|
|
49
|
+
Unlike the Android / Flutter / JS Calls SDKs, **`CometChatCalls` on iOS has no `login()` and no `getLoggedInUser()`** — those methods do not exist in `CometChatCallsSDK` 5.0.1 and earlier (see correction above for 5.0.2+). There is nothing to "log in" to. Once the Chat SDK session exists, you authorize each call session by passing an **auth token** to `generateToken(authToken:sessionID:)`, then `startSession(callToken:callSetting:view:)` with the returned call token (full flow in §1.1).
|
|
48
50
|
|
|
49
51
|
```swift
|
|
50
52
|
import CometChatSDK
|
|
@@ -367,7 +369,7 @@ Pin to `5.0.0..<6.0.0`. SPM resolves `CometChatSDK` automatically.
|
|
|
367
369
|
### CocoaPods
|
|
368
370
|
|
|
369
371
|
```ruby
|
|
370
|
-
platform :ios, '
|
|
372
|
+
platform :ios, '15.1' # REQUIRED for CometChatCallsSDK 5.0.2+ — a lower platform silently resolves 5.0.1 (no initFromSettings)
|
|
371
373
|
target 'YourApp' do
|
|
372
374
|
use_frameworks!
|
|
373
375
|
pod 'CometChatSDK', '~> 4.0' # signaling
|
|
@@ -382,9 +384,33 @@ post_install do |installer|
|
|
|
382
384
|
end
|
|
383
385
|
```
|
|
384
386
|
|
|
385
|
-
### Init
|
|
387
|
+
### Init — file-based with `cometchat-settings.json` (recommended)
|
|
388
|
+
|
|
389
|
+
> **Version requirement (ENG-37137 — Skills Telemetry).** `CometChatCalls.initFromSettings(onSuccess:onError:)` reads a bundled `cometchat-settings.json` and lets the **Calls SDK** self-report `integrationSource = "ai-agent"` to `/user_sessions`. It ships in **`CometChatCallsSDK` >= 5.0.2** (released 2026-07-20). ⚠️ **THE SILENT-DOWNGRADE TRAP: 5.0.2 raised the minimum iOS deployment target to 15.1.** If the Podfile declares `platform :ios` below 15.1, CocoaPods does NOT error — it silently resolves **5.0.1**, which has no `initFromSettings` (and self-reports version 99.0.0). After `pod install`, **verify `Podfile.lock` shows `CometChatCallsSDK (5.0.2)`** — a missing `initFromSettings` symbol at build time means you got 5.0.1. On 5.0.1/5.0.0 the method does not exist — bump the platform to 15.1 (preferred) or use the **`CallAppSettingsBuilder` fallback** below.
|
|
390
|
+
|
|
391
|
+
Like the iOS UI Kit's `CometChatUIKit.initFromSettings` (see `cometchat-ios-core`), the Calls variant takes **no settings argument** — it reads the file straight from the app's main bundle, so the file must be in the target's **Copy Bundle Resources**.
|
|
386
392
|
|
|
387
|
-
|
|
393
|
+
**Step 1 — `cometchat-settings.json`.** It is the SAME unified file the chat-side skills create. If `cometchat-ios-core` already added one, reuse it — just confirm the `callsSDK` section exists. Creating it fresh (calls-only app):
|
|
394
|
+
|
|
395
|
+
```json
|
|
396
|
+
{
|
|
397
|
+
"appId": "APP_ID_HERE",
|
|
398
|
+
"region": "us",
|
|
399
|
+
"credentials": {
|
|
400
|
+
"authKey": "AUTH_KEY_HERE"
|
|
401
|
+
},
|
|
402
|
+
"callsSDK": {
|
|
403
|
+
"host": null,
|
|
404
|
+
"adminHost": null,
|
|
405
|
+
"clientHost": null,
|
|
406
|
+
"callsHost": null
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
`initFromSettings` reads the root `appId` / `region` and the four optional `callsSDK` host overrides; everything else in the unified schema is ignored by the Calls SDK. Add the file to the app target (*File → Add Files…* AND confirm it under *Build Phases → Copy Bundle Resources*) — `SETTINGS_FILE_NOT_FOUND` at init means it's missing from Copy Bundle Resources. Commit the file; treat any `authKey` in it as a public demo credential (same rule as `cometchat-ios-core` §2).
|
|
412
|
+
|
|
413
|
+
**Step 2 — init (no builder, no args):**
|
|
388
414
|
|
|
389
415
|
```swift
|
|
390
416
|
import CometChatSDK
|
|
@@ -398,19 +424,36 @@ let appSettings = AppSettings.AppSettingsBuilder()
|
|
|
398
424
|
CometChat.init(appId: Secrets.cometchatAppID, appSettings: appSettings) { isInitialized, error in
|
|
399
425
|
guard error == nil else { return }
|
|
400
426
|
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
.build()
|
|
405
|
-
|
|
406
|
-
CometChatCalls.init(callsAppSettings: callAppSettings, onSuccess: { _ in
|
|
427
|
+
// File-based init — reads cometchat-settings.json from the bundle and
|
|
428
|
+
// attributes the integration as ai-agent for /user_sessions telemetry.
|
|
429
|
+
CometChatCalls.initFromSettings(onSuccess: { _ in
|
|
407
430
|
// ready — register PushKit (rule 1.2) and CXProvider (rule 1.7) here
|
|
408
431
|
}, onError: { error in
|
|
409
|
-
print("CometChatCalls
|
|
432
|
+
print("CometChatCalls init failed: \(error?.errorDescription ?? "")")
|
|
410
433
|
})
|
|
411
434
|
}
|
|
412
435
|
```
|
|
413
436
|
|
|
437
|
+
**How the attribution works (don't fight it):** `initFromSettings` persists `integrationSource = "ai-agent"` (appId-scoped) *before* delegating to the normal init. The identification POST itself fires on `CometChatCalls.login(...)` success or on a later `init` that restores a persisted session, and is deduped via a SHA-256 hash — repeats are no-ops until the app/SDK version or integration source changes. Two consequences:
|
|
438
|
+
|
|
439
|
+
- **Do NOT scaffold a raw `CallAppSettingsBuilder` init when `initFromSettings` is available** — a direct builder init re-attributes the integration as `manual`.
|
|
440
|
+
- When the **Chat SDK is linked in the same app** (dual-SDK ringing mode, additive mode), the Calls SDK suppresses its own self-report — the chat side reports instead, so ALSO use the chat-side file-based init there (`CometChatUIKit.initFromSettings` — `cometchat-ios-core` §2). The calls-side `initFromSettings` is still the right init (one config file, ai-agent source persisted either way).
|
|
441
|
+
|
|
442
|
+
### Init — `CallAppSettingsBuilder` (fallback — 5.0.1 and earlier)
|
|
443
|
+
|
|
444
|
+
```swift
|
|
445
|
+
let callAppSettings = CallAppSettingsBuilder()
|
|
446
|
+
.setAppId(Secrets.cometchatAppID)
|
|
447
|
+
.setRegion(Secrets.cometchatRegion)
|
|
448
|
+
.build()
|
|
449
|
+
|
|
450
|
+
CometChatCalls.init(callsAppSettings: callAppSettings, onSuccess: { _ in
|
|
451
|
+
// ready
|
|
452
|
+
}, onError: { error in
|
|
453
|
+
print("CometChatCalls.init failed: \(error?.errorDescription ?? "")")
|
|
454
|
+
})
|
|
455
|
+
```
|
|
456
|
+
|
|
414
457
|
Credentials via `Secrets.swift` (gitignored) or `.xcconfig` Build Settings — see `cometchat-ios-core`.
|
|
415
458
|
|
|
416
459
|
---
|
|
@@ -460,7 +503,7 @@ When `product === "voice-video"` and there is no existing UI Kit.
|
|
|
460
503
|
|
|
461
504
|
Calls SDK ONLY. NO Chat SDK, NO CallKit, NO PushKit. Matches `calls-sdk-ios-5/sample-apps/cometchat-calls-sample-app-ios/`. Scaffold:
|
|
462
505
|
|
|
463
|
-
1. **App entry** — `CometChatCalls.
|
|
506
|
+
1. **App entry** — `CometChatCalls.initFromSettings(onSuccess:onError:)` with a bundled `cometchat-settings.json` (§2) ONLY — builder init is the pre-5.0.2 fallback. No `CometChat.init`, no `CometChat.login`, no PushKit, no CallKit. Note: with no Chat SDK linked, the Calls SDK is the only telemetry reporter here, and its send triggers on `CometChatCalls.login` success / persisted-session restore — if the app has identified users, log them in via `CometChatCalls.login(UID:authKey:)` (5.0.2+, see §1.0 correction) rather than hand-passing an auth token to `generateToken`.
|
|
464
507
|
2. **`JoinSessionView.swift`** — UID picker + "Start meeting" / "Join meeting" + state.
|
|
465
508
|
3. **`CallView.swift` + `CallContainerView: UIViewRepresentable`** — `CometChatCalls.generateToken(authToken:sessionID:)` then `CometChatCalls.startSession(callToken:callSetting:view:)`. Coordinator conforms to `CallsEventsDelegate` (set via `CallSettingsBuilder.setDelegate`). See `references/call-session.md`.
|
|
466
509
|
4. **`Info.plist` patch** — Camera + microphone permissions ONLY. No `audio` or `voip` Background Modes needed.
|
|
@@ -472,7 +515,7 @@ Calls SDK ONLY. NO Chat SDK, NO CallKit, NO PushKit. Matches `calls-sdk-ios-5/sa
|
|
|
472
515
|
|
|
473
516
|
Dual-SDK + CallKit + PushKit. Scaffold:
|
|
474
517
|
|
|
475
|
-
1. **App entry** — Chat SDK + Calls SDK init, PushKit + CallKit registration (rule 1.2, 1.7).
|
|
518
|
+
1. **App entry** — Chat SDK + Calls SDK init (both file-based: `CometChat.init` per `cometchat-ios-core`, then `CometChatCalls.initFromSettings` — §2), PushKit + CallKit registration (rule 1.2, 1.7).
|
|
476
519
|
2. **`CallKitProviderDelegate.swift`** — `CXProviderDelegate` implementation. Routes `CXAnswerCallAction` → `CometChatCalls.generateToken` then `startSession(callToken:callSetting:view:)`. Routes `CXEndCallAction` → `CometChatCalls.endSession()` + `AVAudioSession` cleanup (rule 1.5).
|
|
477
520
|
3. **`PushRegistryDelegate.swift`** — `PKPushRegistryDelegate` listening on `.voIP`. On payload → `CXProvider.reportNewIncomingCall` immediately.
|
|
478
521
|
4. **`ProfileView.swift` (SwiftUI) or `ProfileViewController.swift` (UIKit)** — Hosts call buttons next to user info. Tap → `CometChat.initiateCall`.
|
|
@@ -489,7 +532,7 @@ When `cometchat-ios` is already integrated.
|
|
|
489
532
|
|
|
490
533
|
The kit-default additive recipe:
|
|
491
534
|
1. Confirm `CometChatUIKitSwift` is present (CallsSDK is bundled — nothing extra to install).
|
|
492
|
-
2. Set **`.enable(inAppIncomingCall: true)`** on the `UIKitSettings` builder at init (the one calling switch).
|
|
535
|
+
2. Set **`.enable(inAppIncomingCall: true)`** on the `UIKitSettings` builder at init (the one calling switch). If the integration was scaffolded with **`CometChatUIKit.initFromSettings`** (`cometchat-ios-core` §2 — the skills default), telemetry attribution is already handled on the chat side; the vendored calls framework needs no separate init or attribution step.
|
|
493
536
|
3. Add Background Modes (`voip`, `remote-notification`, `audio`) + camera/mic permissions to `Info.plist`.
|
|
494
537
|
4. Drop in `CometChatCallButtons` (e.g. user-details / contact screen) — the kit also auto-renders them in `CometChatMessageHeader` when CallsSDK is present; add `CometChatCallLogs` as a tab/route.
|
|
495
538
|
5. (Optional) CallKit + PushKit for background VoIP (asks user — same opt-in as Android).
|
|
@@ -505,13 +548,15 @@ Only reach for `CometChatCalls.init` + `generateToken`/`startSession` (§1.1) wh
|
|
|
505
548
|
5. **Mixing CallKit and an in-app incoming-call screen** in standalone mode. Causes double-rings and confused state. CallKit owns standalone rings; in-app UI is additive-mode only.
|
|
506
549
|
6. **Using SwiftUI `.alert` for incoming calls.** It only fires when the app is foregrounded. Use CallKit (rule 1.7).
|
|
507
550
|
7. **Pinning `CometChatCallsSDK` to a `4.x`** because that's what the chat SDK is on. They version independently — Calls SDK 5.x is the current calls major.
|
|
551
|
+
8. **Hand-rolling `CallAppSettingsBuilder` init when `initFromSettings` is available (5.0.2+, §2).** The raw builder init re-attributes the integration as `manual` — file-based init is the skills path; the builder is only the pre-5.0.2 fallback.
|
|
508
552
|
|
|
509
553
|
## 7. Verification checklist
|
|
510
554
|
|
|
511
555
|
**Static:**
|
|
512
556
|
|
|
513
557
|
- [ ] `CometChatCallsSDK` in SPM Package.resolved or Podfile.lock
|
|
514
|
-
- [ ] `CometChat.init` followed by `CometChatCalls.
|
|
558
|
+
- [ ] `CometChat.init` followed by `CometChatCalls.initFromSettings` in app entry (builder `CometChatCalls.init` only as the pre-5.0.2 fallback — §2)
|
|
559
|
+
- [ ] `cometchat-settings.json` present, has the `callsSDK` section, and listed under Copy Bundle Resources
|
|
515
560
|
- [ ] PushKit registry listening on `.voIP`
|
|
516
561
|
- [ ] `CXProvider` configured with `CXProviderConfiguration` (app name + ringtone if any)
|
|
517
562
|
- [ ] `CXProviderDelegate` implements answer + end actions
|
|
@@ -57,11 +57,18 @@ import CometChatUIKitSwift
|
|
|
57
57
|
CometChatUIKit.init(uikitSettings: chatSettings) { result in
|
|
58
58
|
switch result {
|
|
59
59
|
case .success:
|
|
60
|
-
// NEW: Calls init AFTER chat init succeeded
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
// NEW: Calls init AFTER chat init succeeded.
|
|
61
|
+
// File-based init (CometChatCallsSDK >= 5.0.2 — requires iOS 15.1+ deployment
|
|
62
|
+
// target or CocoaPods silently resolves 5.0.1 without this API):
|
|
63
|
+
// reads the same bundled cometchat-settings.json the chat side uses and
|
|
64
|
+
// attributes the integration as ai-agent — see cometchat-ios-calls SKILL.md §2.
|
|
65
|
+
CometChatCalls.initFromSettings(onSuccess: { _ in
|
|
66
|
+
// calls ready
|
|
67
|
+
}, onError: { error in
|
|
68
|
+
print("CometChatCalls init failed: \(error?.errorDescription ?? "")")
|
|
69
|
+
})
|
|
70
|
+
// Pre-5.0.2 fallback: CallAppSettingsBuilder().setAppId(...).setRegion(...).build()
|
|
71
|
+
// passed to CometChatCalls.init(callsAppSettings:onSuccess:onError:).
|
|
65
72
|
case .onError(let error):
|
|
66
73
|
print(error)
|
|
67
74
|
}
|
|
@@ -215,7 +215,7 @@ CometChatUIKit.initFromSettings { success, error in
|
|
|
215
215
|
```
|
|
216
216
|
|
|
217
217
|
- If init throws `cometchat-settings.json not found`, the file isn't in **Copy Bundle Resources** — add it there (adding it to the project navigator alone is not enough).
|
|
218
|
-
- **
|
|
218
|
+
- **Commit `cometchat-settings.json` — do not gitignore it** (the file is part of the integration). Its `authKey` is an **optional demo/POC credential**: a quick-start affordance so a PM or developer can see working chat *before* the backend auth-token flow is wired (that flow often waits on internal approvals). Because the file is committed to source control, treat the key as public — use a **dedicated demo CometChat app** (a committed key trips secret scanners and stays in git history; never reuse a production app's key). Switch to a server-minted `authToken` via `loginWithAuthToken` before production, where `authKey` must not ship.
|
|
219
219
|
|
|
220
220
|
### UIKitSettings Builder (fallback — UI Kit before file-based init)
|
|
221
221
|
|
|
@@ -482,6 +482,8 @@ This semantic is the same across all CometChat kits (React, Angular, native iOS,
|
|
|
482
482
|
|
|
483
483
|
When `product === "voice-video"` and there is no existing UI Kit.
|
|
484
484
|
|
|
485
|
+
> **Telemetry attribution (`ai-agent`).** Session mode (§4a, calls SDK only) MUST init via `CometChatCalls.initFromSettings(cometchatSettings)` (`@cometchat/calls-sdk-react-native >= 5.0.3`) — the only reporter in a calls-only app; it fires on `CometChatCalls.login`. **Additive** mode is already attributed by the chat side (`cometchat-native-core` inits chat via `CometChatUIKit.initFromSettings`; with the Chat SDK linked the Calls SDK suppresses its own report). **Ringing mode (§4b)** links the raw Chat SDK for signaling only — use `CometChatCalls.initFromSettings` there too so the calls side carries the flag.
|
|
486
|
+
|
|
485
487
|
**Split by calling mode — these are two different shapes:**
|
|
486
488
|
|
|
487
489
|
### 4a. Standalone — Session mode (meeting-room UX, no ringing)
|
|
@@ -575,7 +577,7 @@ Verify checks: `rn_webrtc_peers` (11-peer presence) + `no_chat_sdk_in_session_on
|
|
|
575
577
|
|
|
576
578
|
The skill then scaffolds:
|
|
577
579
|
|
|
578
|
-
1. **`cometchat/init.ts`** — `CometChatCalls.
|
|
580
|
+
1. **`cometchat/init.ts`** — file-based init so the calls-only app self-reports `integrationSource = "ai-agent"`. Import the committed `cometchat-settings.json` and call **`CometChatCalls.initFromSettings(cometchatSettings)`** (`@cometchat/calls-sdk-react-native >= 5.0.3`, verified against the published types; returns `Promise<{ success, error }>` — check `.success`). No `CometChat.init`, no `CometChat.login`. On an older calls SDK the method does not exist — fall back to `CometChatCalls.init({ appId, region, authKey })`. Put `authKey` in the settings file so `CometChatCalls.login(uid)` needs no second arg. **The `ai-agent` report fires on `CometChatCalls.login` success**, so a session-only app must log the user in via `CometChatCalls.login(uid)`. Do NOT hand-roll the raw `init` when `initFromSettings` is available — a bare `init` re-attributes as `manual`.
|
|
579
581
|
2. **`screens/JoinSession.tsx`** — UID picker + Start/Join meeting + state machine (`inMeeting && callToken`).
|
|
580
582
|
3. **`screens/CallRoom.tsx`** — Renders `<CometChatCalls.Component callToken={callToken} />` inside `SafeAreaView`. `onConnectionClosed` listener resets state. See `references/call-session.md`.
|
|
581
583
|
4. **No VoIP push** — session mode is link-driven, not ringing-driven. No `react-native-callkeep`, no PushKit, no FCM data messages.
|
|
@@ -74,7 +74,7 @@ await CometChatUIKit.initFromSettings(cometchatSettings);
|
|
|
74
74
|
// then: CometChatUIKit.login({ uid }) — see §2
|
|
75
75
|
```
|
|
76
76
|
|
|
77
|
-
- **
|
|
77
|
+
- **Commit `cometchat-settings.json` — do not gitignore it** (the file is part of the integration). Its `authKey` is an **optional demo/POC credential**: a quick-start affordance so a PM or developer can see working chat *before* the backend auth-token flow is wired (that flow often waits on internal approvals). Because the file is committed to source control, treat the key as public — use a **dedicated demo CometChat app** (a committed key trips secret scanners and stays in git history; never reuse a production app's key). Switch to a server-minted `authToken` via `loginWithAuthToken` before production, where `authKey` must not ship.
|
|
78
78
|
- The init-once flag + "init before first render" rules below apply unchanged — just swap the `init({...})` call for `initFromSettings(cometchatSettings)`.
|
|
79
79
|
|
|
80
80
|
### UIKitSettings — the init object (fallback — UI Kit before file-based init)
|
|
@@ -527,7 +527,8 @@ CometChat Calls SDK is browser-only — `window`, `MediaStream`, `RTCPeerConnect
|
|
|
527
527
|
|
|
528
528
|
| Class / function | Purpose |
|
|
529
529
|
|---|---|
|
|
530
|
-
| `CometChatCalls.
|
|
530
|
+
| `CometChatCalls.initFromSettings(cometchatSettings)` | **Preferred one-time init** (`calls-sdk-javascript >= 5.0.3`). Reads the imported `cometchat-settings.json`, persists `integrationSource = "ai-agent"`, returns `Promise<{ success, error }>`. Use in standalone/session mode. |
|
|
531
|
+
| `CometChatCalls.init({ appId, region })` | One-time init — **fallback for calls SDK < 5.0.3** (no telemetry attribution; reports `manual`). Returns `Promise<{ success, error }>` — check `.success`. |
|
|
531
532
|
| `CometChatCalls.login(uid, apiKey)` | Dev-mode login. Returns the logged-in `User`. |
|
|
532
533
|
| `CometChatCalls.loginWithAuthToken(authToken)` | Production login with server-minted token. |
|
|
533
534
|
| `CometChatCalls.getLoggedInUser()` | Returns a plain `{ uid, name, avatar?, status?, ... }` object or `null`. Access `.uid` as a PROPERTY (not `.getUid()` — that method belongs to the Chat SDK's `User` class, which session-only code does not import). Use to guard against double-login: `if (existing && existing.uid === uid) return existing;` |
|
|
@@ -571,13 +572,15 @@ In standalone mode, you can compose just `<CometChatOngoingCall />` + `<CometCha
|
|
|
571
572
|
|
|
572
573
|
When `product === "voice-video"` and there is no existing chat UI integration.
|
|
573
574
|
|
|
575
|
+
> **Telemetry attribution (`ai-agent`).** Session mode (§4a, calls SDK only) MUST init via `CometChatCalls.initFromSettings(cometchatSettings)` (`calls-sdk-javascript >= 5.0.3`) — that's the only reporter in a calls-only app, and it fires on `CometChatCalls.login`. **Additive** mode (calls on an existing chat integration) is already attributed by the chat side — `cometchat-core` inits chat via `CometChatUIKit.initFromSettings`, and when the Chat SDK is linked the Calls SDK suppresses its own report. **Ringing mode (§4b)** links the raw Chat SDK for signaling but has no chat UI-Kit init; use `CometChatCalls.initFromSettings` there too so the calls side carries the flag.
|
|
576
|
+
|
|
574
577
|
**Split by calling mode — these are two different shapes:**
|
|
575
578
|
|
|
576
579
|
### 4a. Standalone — Session mode (meeting-room UX, no ringing)
|
|
577
580
|
|
|
578
581
|
Calls SDK ONLY. NO Chat SDK. Matches the upstream sample at `calls-sdk-javascript-5/sample-apps/cometchat-calls-sample-app-react/`. The skill scaffolds:
|
|
579
582
|
|
|
580
|
-
1. **`cometchat/init.ts`** — `CometChatCalls.
|
|
583
|
+
1. **`cometchat/init.ts`** — file-based init so the calls-only app self-reports `integrationSource = "ai-agent"`. Import the committed `cometchat-settings.json` and call **`CometChatCalls.initFromSettings(cometchatSettings)`** — it maps the shared settings shape onto the Calls SDK and returns `Promise<{ success, error }>` (check `.success`). No `CometChat.init`, no `CometChat.login`. **Version:** `initFromSettings` ships in `@cometchat/calls-sdk-javascript >= 5.0.3` (verified against the published types); on an older calls SDK the method does not exist — fall back to `CometChatCalls.init({ appId, region, authKey })`. Pass `authKey` in the settings file so `CometChatCalls.login(uid)` needs no second arg. **Attribution:** the `ai-agent` report fires on `CometChatCalls.login` success — a session-mode app with identified users must log in via `CometChatCalls.login(uid)` (not just hand a token to `generateToken`). Do NOT hand-roll the raw `init` when `initFromSettings` is available — a bare `init` re-attributes the integration as `manual`.
|
|
581
584
|
2. **`cometchat/CometChatProvider.tsx`** — Runs Calls SDK init on mount, exposes `loggedInUser` via `CometChatCalls.getLoggedInUser()`, gates children on success.
|
|
582
585
|
3. **`pages/Home.tsx`** — UID picker (dev mode) + "Start meeting" (mints UUID, navigates to `/meet/:id`) + "Join meeting" (paste sessionId).
|
|
583
586
|
4. **`pages/CallRoom.tsx`** — `/meet/:sessionId` route. Container is `position: fixed; width: 100vw; height: 100vh`. `CometChatCalls.joinSession(token, {}, container)` with empty settings. See `references/call-session.md` for the canonical pattern.
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 CometChat
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|