cometchat-calls
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseUse this skill when
何时使用该技能
- The top-level dispatcher's Step 3.0 routes here because
cometchatorproduct === "voice-video"chat-messaging+voice-video - The user explicitly asks for calling: "add calls", "add video calling", "add voice calls", "set up call screen", "integrate calls SDK", "add CallKit"
- The user is iterating on an existing chat integration and picks "Add calling" from the iteration menu (Step 7 of )
cometchat
This is the entry point for every calls integration. Do NOT invoke per-family skills directly — this dispatcher detects the family, picks the integration mode (standalone vs additive), and routes to the right skill with the right preconditions.
cometchat-{family}-callsSupported families:
| Family | Per-family skill | Calls SDK package | Stable today? |
|---|---|---|---|
| Web (React / Next.js / React Router / Astro) | | | Yes |
| React Native (Expo + bare) | | | Yes |
| Angular (12–15) | | | Yes |
| Android (V5 stable) | | | Yes — production-ready |
| Android (V6 beta) | | Calls fold into | Beta |
| iOS (V5 stable) | | | Yes |
| Flutter (V5 stable) | | | Yes |
| Flutter (V6 beta) | | Calls fold into | Beta |
Status: This dispatcher is the v4.1 entry point. Per-family skill stubs are scaffolded and being filled in. Flutter v5/v6 calls skills already exist from v4.0.0 and will be audited and brought into the same shape; the other six are being authored againstas ground truth (Android ships 17 pre-authored sub-skills folded into~/Downloads/calls-sdk/calls-sdk-{android,ios,javascript,react-native}-5/).cometchat-android-v5-calls/references/
- 顶级调度器的步骤3.0将请求路由至此,因为
cometchat或product === "voice-video"chat-messaging+voice-video - 用户明确要求添加通话功能:例如*"添加通话"、"添加视频通话"、"添加语音通话"、"设置通话界面"、"集成通话SDK"、"添加CallKit"*
- 用户正在迭代现有聊天集成,并从迭代菜单中选择*"添加通话"*(的步骤7)
cometchat
这是所有通话集成的入口。请勿直接调用各平台专属的技能——该调度器会检测平台类型,选择集成模式(独立或附加),并携带正确前置条件路由至对应技能。
cometchat-{family}-calls支持的平台类型:
| Family | 平台专属技能 | Calls SDK 包 | 当前是否稳定? |
|---|---|---|---|
| Web (React / Next.js / React Router / Astro) | | | 是 |
| React Native (Expo + 原生) | | | 是 |
| Angular (12–15) | | | 是 |
| Android (V5 稳定版) | | | 是——可用于生产环境 |
| Android (V6 测试版) | | 通话功能已整合至V6的 | 测试版 |
| iOS (V5 稳定版) | | | 是 |
| Flutter (V5 稳定版) | | | 是 |
| Flutter (V6 测试版) | | 通话功能已整合至 | 测试版 |
状态说明: 该调度器是v4.1版本的入口。各平台专属技能的框架已搭建完成并正在填充内容。Flutter v5/v6通话技能自v4.0.0版本起已存在,将进行审核并统一格式;其余6项技能正基于作为基准进行编写(Android平台包含17个预编写的子技能,整合至~/Downloads/calls-sdk/calls-sdk-{android,ios,javascript,react-native}-5/)。cometchat-android-v5-calls/references/
Why a separate calls dispatcher
为何需要独立的通话调度器
The chat dispatcher () assumes the user is adding a chat surface — its placement vocabulary, component catalog, framework skills, and verification checklist are all chat-shaped. Calls is a different surface area:
cometchat/SKILL.md| Concern | Chat dispatcher | Calls dispatcher (this skill) |
|---|---|---|
| Packages | | |
| Init | Chat SDK init + login | Chat SDK init + login + Calls SDK |
| Placement question | "Where does chat live?" | "Where does the call trigger live?" + "Where do call logs live?" |
| Components | Conversations, MessageList, Composer, Users, Groups | CallButtons, IncomingCall, OutgoingCall, OngoingCall, CallLogs |
| At chat surface (rings while user is chatting) | At app root — always-rendering, listens app-wide |
| VoIP push (mobile) | Optional add-on | Mandatory in standalone mode — calls without ringing isn't a product |
| Background lifecycle | N/A unless calls feature added | Required — Android foreground service / iOS CallKit + PushKit |
The two dispatchers share (init + login + env + theme tokens) but diverge on everything else.
cometchat-{family}-core聊天调度器()假设用户正在添加聊天界面——其布局术语、组件目录、框架技能和验证清单均围绕聊天场景设计。通话属于不同的场景范畴:
cometchat/SKILL.md| 关注点 | 聊天调度器 | 通话调度器(本技能) |
|---|---|---|
| 包依赖 | | |
| 初始化流程 | Chat SDK初始化 + 登录 | Chat SDK初始化 + 登录 + Calls SDK |
| 布局问题 | "聊天界面放置在哪里?" | "通话触发按钮放置在哪里?" + "通话记录放置在哪里?" |
| 组件 | Conversations、MessageList、Composer、Users、Groups | CallButtons、IncomingCall、OutgoingCall、OngoingCall、CallLogs |
| 聊天界面内(用户聊天时响铃) | 应用根节点——始终渲染,全局监听 |
| 移动VoIP推送 | 可选附加功能 | 独立模式下为必填项——无响铃的通话不具备产品价值 |
| 后台生命周期 | 除非添加通话功能,否则无需关注 | 必填项——Android前台服务 / iOS CallKit + PushKit |
两个调度器共享(初始化+登录+环境+主题令牌),但其余部分均不同。
cometchat-{family}-coreHow v4.1 calls integration works
v4.1版本通话集成流程
Same conversational model as the chat dispatcher — detect, gather, plan, write, verify — but with a calls lens.
采用与聊天调度器相同的对话模型——检测、收集信息、规划、编写代码、验证,但围绕通话场景展开。
Steps
步骤
Step 1 — Detect family + mode
步骤1 — 检测平台类型与集成模式
If the user came from the top-level dispatcher, framework + credentials are already in . Skip detection and read:
cometchat.cometchat/config.jsonbash
npx @cometchat/skills-cli config show --jsonIf invoked directly (e.g. user typed "add calls to my app"), run:
bash
npx @cometchat/skills-cli detect --jsonSame family detection as the chat dispatcher (, , , , , , , , , ).
reactjsnextjsreact-routerastroexporeact-nativeangularandroidflutteriosPick the integration mode by looking at the project state:
| Signal | Mode | What runs |
|---|---|---|
| Additive — calls layered onto existing chat | Per-family |
| Standalone — calls is the product | Per-family |
| Neither — user wants calls but it's ambiguous | Ask | AskUserQuestion: "Are you adding calling alongside an existing chat integration, or building a calling-first app?" |
如果用户来自顶级调度器,框架信息和凭证已存储在中。跳过检测步骤,直接读取:
cometchat.cometchat/config.jsonbash
npx @cometchat/skills-cli config show --json如果直接调用本技能(例如用户输入*"为我的应用添加通话功能"*),则运行:
bash
npx @cometchat/skills-cli detect --json平台类型检测逻辑与聊天调度器相同(、、、、、、、、、)。
reactjsnextjsreact-routerastroexporeact-nativeangularandroidflutterios根据项目状态选择集成模式:
| 信号 | 模式 | 执行操作 |
|---|---|---|
| 附加模式——在现有聊天基础上添加通话功能 | 调用平台专属 |
| 独立模式——通话为核心产品 | 调用平台专属 |
| 以上均不满足——用户需要通话但场景模糊 | 询问用户 | 向用户提问:"您是要在现有聊天集成基础上添加通话功能,还是要构建以通话为核心的应用?" |
Step 2 — Verify credentials
步骤2 — 验证凭证
Calls reuses Chat SDK credentials. If (web/RN), (Android), (iOS), (Flutter), or (Angular) already has / / , skip credential setup.
.envlocal.propertiesSecrets.swiftlib/cometchat_config.dartsrc/environments/environment.tsappIdregionauthKeyIf credentials are missing, hand back to Step 2 — credential provisioning is the same regardless of product. Do not duplicate the auth flow here.
cometchat/SKILL.md通话功能复用Chat SDK的凭证。如果(Web/RN)、(Android)、(iOS)、(Flutter)或(Angular)中已包含//,跳过凭证设置步骤。
.envlocal.propertiesSecrets.swiftlib/cometchat_config.dartsrc/environments/environment.tsappIdregionauthKey如果缺少凭证,跳转至的步骤2——凭证配置流程与产品类型无关,请勿在此处重复认证流程。
cometchat/SKILL.mdStep 3 — Gather calls-specific requirements
步骤3 — 收集通话专属需求
Step 3.0 — Calling mode (Ringing vs Session) ★
步骤3.0 — 通话模式(响铃式 vs 会话式)★
This is the first calls-specific question. The Calls SDK supports two fundamentally different UX shapes — pick before anything else, because the rest of Step 3 + the per-family scaffold differ.
Resolve in priority order:
1. Infer ONLY from explicit signals. Don't default to either mode. The user must clearly indicate one of the two flavors before you skip the prompt:
| User said something like… | Mode |
|---|---|
| "1:1 call", "user to user call", "phone call", "ring my friend", "call a contact", "FaceTime-like", "WhatsApp-style call" | Ringing |
| "group call between friends", "conference call up to N people" (small group, one initiator who rings) | Ringing |
| "meeting", "Google Meet", "Zoom-like", "scheduled meeting", "join with a link", "meeting room", "conference room", "webinar", "town hall", "virtual classroom" | Session |
| "huddle" (Slack-style — instant join from a channel) | Session |
| Just "calls", "calling", "integrate calls", "add calls", "set up calling", "voice/video calls" with NO further context about ringing-vs-meeting | AMBIGUOUS — ASK (do NOT default) |
| Mixed signals ("calls and meetings", "phone calls or video conferencing") | AMBIGUOUS — ASK |
The bottom rows are the load-bearing ones. Generic phrases like "integrate calls" or "I want calling in my app" are NOT a signal for Ringing — they're a signal that the user hasn't told you yet. Ask.
If you DO have a clear signal, confirm with one line so the user can redirect:
"Got it — setting up Ringing (1:1 / group calls with an incoming-call screen). If you wanted meeting-room URLs instead, say so and I'll switch."
2. Use Tier 4 use-case context if available. Use-cases telegraph the mode:
| Use case | Mode |
|---|---|
| Telehealth provider/patient (1:1 visit) | Ringing |
| Marketplace buyer ↔ seller | Ringing |
| Customer support (agent ↔ customer) | Ringing |
| Broadcast / webinar / town hall | Session |
| Team huddle / standup | Session |
3. Only if you can't tell — ask. Use this prompt verbatim — do NOT rephrase, do NOT swap options. Option 1 is "Session"; option 2 is "Ringing":
- question: "What kind of calling experience are you building?"
- header: "Calling mode"
- multiSelect: false
- options (display in this exact order — Session FIRST, Ringing SECOND):
- label: "Session — meeting / conference room", description: "Multiple users join the same session by ID or link. No ringing. Like Google Meet, Zoom, or a Slack huddle. Examples: scheduled meetings, webinars, team huddles, classroom calls."
- label: "Ringing — 1:1 or group calls", description: "One user calls another (or a small group). Recipient's device rings; they accept or decline. Like a phone call. Examples: WhatsApp, FaceTime, in-app voice/video calls between contacts."
Strict-order rule: render option 1 above option 2. Do not reorder. Session-first is standardized across CometChat product surfaces.
Map to mode value:
- "Ringing" →
mode === "ringing" - "Session" →
mode === "session"
This drives which per-family reference loads at Step 6:
| Mode | Reference (per-family) | Reference (Android V5) |
|---|---|---|
| | |
| | |
Note on the kit's prebuilt UI ("Standard" mode in earlier docs): the UI Kit's+<CometChatCallButtons />+<CometChatIncomingCall />are a kit-provided implementation of Ringing, not a third mode. If the user picks Ringing AND wants the kit's prebuilt UI (most common), the per-family scaffold uses kit components and treats the ringing reference as the architectural ground-truth. If they want custom UI on top of the chat-SDK signaling, the ringing reference is the implementation guide.<CometChatOngoingCall />
⚠️ Group calls do NOT use the Ringing channel (validated 2026-05-15, applies to all kits). The kit'ssends a custom meeting message to the group via<CometChatCallButtons group={g}>withCometChat.sendCustomMessage, NOTtype: "meeting". Other group members receive the meeting card inCometChat.initiateCall(kit-based receivers) OR a<CometChatMessageList />withMessageListener.onCustomMessageReceived+category: CATEGORY_CUSTOM(custom-UI receivers). Thetype: "meeting"channel only fires for 1:1 user calls. If the user wants group calls, loadCallListener.onIncomingCallReceivedIN ADDITION TO ringing-integration.md — group has its own architecture even though customers think of it as "ringing for groups."references/group-calls.md
这是第一个通话专属问题。Calls SDK支持两种完全不同的UX形态——需优先选择,因为步骤3的其余部分和平台专属框架均会受此影响。
按优先级判断:
1. 仅根据明确信号推断。请勿默认任何一种模式。用户必须明确指示其中一种类型,否则需提示用户:
| 用户表述类似… | 模式 |
|---|---|
| "一对一通话"、"用户间通话"、"电话呼叫"、"呼叫我的好友"、"联系通话"、"类似FaceTime"、"WhatsApp风格通话" | 响铃式 |
| "好友间群组通话"、"最多N人的会议通话"(小型群组,由一人发起并响铃) | 响铃式 |
| "会议"、"类似Google Meet"、"类似Zoom"、"预定会议"、通过链接加入"、"会议室"、"研讨会"、"全体大会"、"虚拟课堂" | 会话式 |
| "临时会议"(Slack风格——从频道即时加入) | 会话式 |
| 仅提及"通话"、"呼叫"、"集成通话"、"添加通话"、"设置通话"、"语音/视频通话",未进一步说明响铃式与会话式的区别 | 场景模糊——询问用户(请勿默认) |
| 混合信号("通话和会议"、"电话或视频会议") | 场景模糊——询问用户 |
最后两行是关键。诸如"集成通话"或"我想在应用中添加通话功能"之类的通用表述并非响铃式的信号——这表明用户尚未明确需求。请询问用户。
如果有明确信号,用一句话确认以便用户调整:
"已了解——将设置为响铃式(一对一/群组通话,带有来电界面)。如果您需要会议室链接模式,请告知我,我将切换。"
2. 如果有可用的Tier 4用例上下文,可参考。用例会暗示所需模式:
| 用例 | 模式 |
|---|---|
| 远程医疗(医患一对一问诊) | 响铃式 |
| 电商平台(买家↔卖家) | 响铃式 |
| 客户支持(客服↔客户) | 响铃式 |
| 直播/研讨会/全体大会 | 会话式 |
| 团队临时会议/站会 | 会话式 |
3. 若无法判断——询问用户。请严格使用以下提示语——请勿改写,请勿调换选项顺序。选项1为"会话式";选项2为"响铃式":
- 问题: "您要构建哪种通话体验?"
- 标题: "通话模式"
- 多选: false
- 选项(严格按此顺序展示——会话式在前,响铃式在后):
- 标签:"会话式——会议/会议室",描述:"多个用户通过ID或链接加入同一会话。无响铃。类似Google Meet、Zoom或Slack临时会议。示例:预定会议、研讨会、团队临时会议、课堂通话。"
- 标签:"响铃式——一对一或群组通话",描述:"一个用户呼叫另一个用户(或小型群组)。接收方设备响铃;用户可接听或拒绝。类似电话呼叫。示例:WhatsApp、FaceTime、应用内联系人语音/视频通话。"
严格顺序规则: 选项1显示在选项2上方。请勿调整顺序。会话式优先是CometChat产品界面的标准设定。
映射至模式值:
- "响铃式" →
mode === "ringing" - "会话式" →
mode === "session"
这将决定步骤6加载哪个平台专属参考文档:
| 模式 | 平台专属参考文档 | Android V5参考文档 |
|---|---|---|
| | |
| | |
关于套件预构建UI(早期文档中的"Standard"模式)的说明: UI Kit的+<CometChatCallButtons />+<CometChatIncomingCall />是响铃式的套件实现,并非第三种模式。如果用户选择响铃式且需要套件预构建UI(最常见场景),平台专属框架将使用套件组件,并将响铃式参考文档作为架构基准。如果用户需要在Chat SDK信令之上自定义UI,响铃式参考文档将作为实现指南。<CometChatOngoingCall />
⚠️ 群组通话不使用响铃通道(2026-05-15验证,适用于所有套件)。套件的会通过<CometChatCallButtons group={g}>向群组发送自定义会议消息,类型为CometChat.sendCustomMessage,而非"meeting"。其他群成员会在CometChat.initiateCall(基于套件的接收方)中收到会议卡片,或通过<CometChatMessageList />(自定义UI接收方)收到MessageListener.onCustomMessageReceived+category: CATEGORY_CUSTOM的消息。type: "meeting"通道仅在一对一用户通话时触发。如果用户需要群组通话,除加载CallListener.onIncomingCallReceived外,还需加载ringing-integration.md——群组通话有独立的架构,尽管客户认为它是"群组版响铃式通话"。references/group-calls.md
Step 3.1 — Call trigger placement (where the call starts from)
步骤3.1 — 通话触发按钮位置(通话发起入口)
Different from the chat dispatcher's Step 3a archetype question. Ask placement-intent on the calls surface:
Ask the user (preserve the structured shape — ////):
questionheadermultiSelectoptions[].labeloptions[].description-
question: "How should users start a call in your app?"
-
header: "Call trigger"
-
multiSelect: false
-
options (the option set differs by mode — show only the rows matchingfrom Step 3.0):
modeIf— show these:mode === "ringing"- label: "Call button on user/contact profile", description: "Voice + video buttons next to a user's name. Best for marketplaces, social, dating, healthcare."
- label: "Always-on '/calls' route", description: "Dedicated calls page with a 'Start a call' picker and call history. Best for telehealth, virtual events, contact centers."
- label: "Embedded in chat surface", description: "Call buttons in the chat header — voice + video next to message threads. Best for apps that already have chat. (Additive mode only.)"
- label: "Floating widget", description: "Always-visible call bubble — like Zoom's floating window. Best for support / sales tools."
If— show these instead:mode === "session"- label: "Meeting link route ('/meet/:sessionId')", description: "Shareable URLs that anyone with the link can join. Best for scheduled meetings, webinars, classrooms."
- label: "Channel-bound huddle", description: "Session keyed to a chat channel/group ID — anyone in the channel can join the active huddle. Best for team collab apps."
- label: "Lobby / waiting-room route", description: "User lands on a waiting screen, host admits. Best for telehealth, customer support."
- label: "Custom — I'll wire it myself", description: "Just give me the SDK glue. I'll decide the surface."
The chosen option drives which per-family skill section to load and what to scaffold.
-callsThen ask about call logs separately — call logs are usually a different surface from the trigger:
- question: "Where should call history live?"
- header: "Call logs"
- options:
- label: "Dedicated /calls route (or screen)", description: "Recommended — full call history, filterable, jump to caller's profile."
- label: "Inside the call trigger surface", description: "Compact list under the call button. Best when call volume is low."
- label: "Don't show call history", description: "Skip — calls just happen, no log surface."
与聊天调度器的步骤3a原型问题不同。需询问通话界面的布局意图:
向用户提问(保留结构化格式——////):
questionheadermultiSelectoptions[].labeloptions[].description-
问题: "用户应如何在您的应用中发起通话?"
-
标题: "通话触发入口"
-
多选: false
-
选项(选项集因模式而异——仅显示与步骤3.0中匹配的选项):
mode如果——显示以下选项:mode === "ringing"- 标签:"用户/联系人资料页上的通话按钮",描述:"用户名称旁的语音+视频按钮。适用于电商平台、社交、交友、医疗健康场景。"
- 标签:"常驻'/calls'路由",描述:"专用通话页面,包含'发起通话'选择器和通话记录。适用于远程医疗、虚拟活动、客服中心场景。"
- 标签:"嵌入聊天界面",描述:"聊天头部的通话按钮——消息线程旁的语音+视频按钮。适用于已具备聊天功能的应用。(仅附加模式可用。)"
- 标签:"悬浮组件",描述:"始终可见的通话气泡——类似Zoom的悬浮窗口。适用于客服/销售工具场景。"
如果——改为显示以下选项:mode === "session"- 标签:"会议链接路由('/meet/:sessionId')",描述:"可分享的URL,任何拥有链接的用户均可加入。适用于预定会议、研讨会、课堂场景。"
- 标签:"频道绑定临时会议",描述:会话与聊天频道/群组ID关联——频道内任何用户均可加入正在进行的临时会议。适用于团队协作应用场景。"
- 标签:"等候室路由",描述:用户进入等待界面,由主持人准入。适用于远程医疗、客户支持场景。"
- 标签:"自定义——我将自行配置",描述:"只需提供SDK关联代码。我将自行决定界面布局。"
所选选项将决定加载平台专属技能的哪个部分以及框架内容。
-calls随后单独询问通话记录位置——通话记录通常与触发入口位于不同界面:
- 问题: "通话记录应放置在哪里?"
- 标题: "通话记录"
- 选项:
- 标签:"专用'/calls'路由(或页面)",描述:"推荐方案——完整通话记录,支持筛选,可跳转至呼叫方资料页。"
- 标签:"嵌入通话触发入口界面",描述:"通话按钮下方的紧凑列表。适用于通话量较低的场景。"
- 标签:"不显示通话记录",描述:"跳过——仅进行通话,无记录界面。"
Step 4 — Detect mandatory mobile prerequisites
步骤4 — 检测移动端必填前置条件
For mobile families (, , , , ), VoIP push is non-negotiable in standalone mode — without it, missed calls don't ring. Detect what's already wired so the per-family skill knows what to add and what to skip:
androidiosexporeact-nativeflutter-callsAndroid:
- Firebase Cloud Messaging — look for in
google-services.jsonandapp/inid("com.google.gms.google-services")app/build.gradle{.kts} - Service registration — look for in
<service android:name=".YourFirebaseMessagingService" ...>AndroidManifest.xml - ConnectionService — look for and
android.permission.MANAGE_OWN_CALLSinBIND_TELECOM_CONNECTION_SERVICEAndroidManifest.xml - Foreground service type — look for (Android 14+ silently crashes without
<service android:foregroundServiceType="phoneCall|microphone|camera">)phoneCall
iOS:
- CallKit — look for and a
import CallKitconfigured somewhere in sourceCXProvider - PushKit — look for and a
import PushKitlistener (VoIP push token registration)PKPushRegistry - Capabilities — look for with
Background Modes+voip+audioinremote-notificationandInfo.plistentitlements - Microphone + camera Info.plist usage strings
React Native:
- (CallKit + ConnectionService bridge) in
react-native-callkeeppackage.json - (Android) and a
@react-native-firebase/messagingsetupPushNotificationIOS - for iOS VoIP push tokens
react-native-voip-push-notification
Flutter:
- in
flutter_callkit_incoming, OR a platform-channel bridge to native CallKit/ConnectionServicepubspec.yaml - for FCM
firebase_messaging - Native and
Info.plistentries (Flutter doesn't auto-add these)AndroidManifest.xml
Surface what's wired and what's missing. The per-family skill writes the missing pieces — it never assumes they're already there.
-calls对于移动平台(、、、、),独立模式下VoIP推送是不可协商的必填项——没有VoIP推送,未接来电无法响铃。检测已配置的内容,以便平台专属技能了解需要添加和跳过的部分:
androidiosexporeact-nativeflutter-callsAndroid:
- Firebase Cloud Messaging——检查目录下的
app/和google-services.json中的app/build.gradle{.kts}id("com.google.gms.google-services") - 服务注册——检查中的
AndroidManifest.xml<service android:name=".YourFirebaseMessagingService" ...> - ConnectionService——检查中的
AndroidManifest.xml和android.permission.MANAGE_OWN_CALLS权限BIND_TELECOM_CONNECTION_SERVICE - 前台服务类型——检查(Android 14+若缺少
<service android:foregroundServiceType="phoneCall|microphone|camera">会静默崩溃)phoneCall
iOS:
- CallKit——检查源代码中是否有和配置好的
import CallKitCXProvider - PushKit——检查源代码中是否有和
import PushKit监听器(VoIP推送令牌注册)PKPushRegistry - 权限——检查和
Info.plist中是否开启entitlements并勾选Background Modes+voip+audioremote-notification - 麦克风+相机权限的Info.plist使用说明字符串
React Native:
- 中的
package.json(CallKit + ConnectionService桥接)react-native-callkeep - Android平台的和iOS平台的
@react-native-firebase/messaging配置PushNotificationIOS - iOS平台的用于VoIP推送令牌
react-native-voip-push-notification
Flutter:
- 中的
pubspec.yaml,或与原生CallKit/ConnectionService的平台通道桥接flutter_callkit_incoming - 用于FCM
firebase_messaging - 原生和
Info.plist配置项(Flutter不会自动添加这些)AndroidManifest.xml
展示已配置和缺失的内容。平台专属技能会补充缺失部分——绝不假设这些内容已存在。
-callsStep 5 — Show the plan and get approval
步骤5 — 展示规划并获取用户确认
Before writing anything, show the user exactly:
- Which packages will be installed
- Which files will be created vs modified vs left alone
- Where the call trigger will land (with the file path)
- Where call logs will land (or "skipped" if option 3 above)
- For mobile: what VoIP push artifacts will be added (FCM service, CallKit provider, foreground service registration, manifest permissions, Info.plist entries)
- What the user must do manually that the skill can't (Android: enable FCM in Firebase console; iOS: add VoIP Services certificate to App Store Connect; Flutter: bump if below platform floor)
minSdkVersion
Wait for explicit approval. Then load the per-family skill and run its scaffold.
-calls在编写任何代码之前,向用户明确展示:
- 将安装的包
- 将创建、修改或保留的文件
- 通话触发按钮的位置(含文件路径)
- 通话记录的位置(若选择选项3则显示"跳过")
- 移动端:将添加的VoIP推送相关内容(FCM服务、CallKit provider、前台服务注册、清单权限、Info.plist配置项)
- 用户必须手动完成的操作(技能无法自动完成):Android:在Firebase控制台启用FCM;iOS:在App Store Connect添加VoIP服务证书;Flutter:若低于平台要求则升级
minSdkVersion
等待用户明确确认。然后加载平台专属技能并运行其框架。
-callsStep 6 — Hand off to the per-family skill
步骤6 — 移交至平台专属技能
Load the matching skill from your context:
| Detected family | Skill to load |
|---|---|
| |
| |
| |
| |
| |
| |
| |
| |
Pass the gathered context: ( | from Step 3.0), standalone vs additive (Step 1), trigger placement (Step 3.1), log placement, mobile prereqs status.
moderingingsessionThe per-family skill loads the matching mode reference as its primary blueprint:
| Reference loaded inside the per-family skill |
|---|---|
| |
| |
Additionally — if in the gathered context (the user mentioned "group calls", "team meetings", "huddles", or selected as a call target in Step 3.1), ALSO load from the per-family skill. Group calls use a different signaling channel than 1:1 ringing — they broadcast a custom message instead of . Loading only produces code that works for 1:1 but silently breaks for groups on custom-UI receivers. The reference exists for all 8 families. See the Step 3.0 disclosure above for the underlying semantic.
groupCalls === truegroupreferences/group-calls.md"meeting"CometChat.initiateCallringing-integration.mdgroup-calls.mdThe per-family skill writes code; this dispatcher does not.
If the per-family skill isn't loaded into the agent's context (i.e. the user installed before v4.1 and never re-ran ), tell the user once:
@cometchat/skillsnpx @cometchat/skills add --family <family>"I just installed the {family} calls skill into your workspace. Please re-runto continue — your config is saved in/cometchat-calls, so the next run picks up at code generation without re-asking the placement questions.".cometchat/config.json
Same hot-reload constraint as the chat dispatcher: agents snapshot the skill set at session start and don't reload mid-session. Continuing this session would mean writing calls code from training memory — which the per-family skill explicitly forbids.
从上下文加载匹配的技能:
| 检测到的平台类型 | 加载的技能 |
|---|---|
| |
| |
| |
| |
| |
| |
| |
| |
传递收集到的上下文信息:(步骤3.0中的 | )、独立/附加模式(步骤1)、触发按钮位置(步骤3.1)、通话记录位置、移动端前置条件状态。
moderingingsession平台专属技能会加载匹配模式的参考文档作为主要蓝图:
| 平台专属技能内加载的参考文档 |
|---|---|
| |
| |
此外——如果收集到的上下文信息中(用户提及"群组通话"、"团队会议"、"临时会议",或在步骤3.1中选择作为通话目标),还需从平台专属技能中加载。群组通话使用的信令通道与一对一响铃式通话不同——它们会广播自定义消息,而非。仅加载会生成仅适用于一对一通话但在自定义UI接收方的群组通话场景中静默失效的代码。所有8个平台均提供参考文档。请参阅步骤3.0中的披露了解底层逻辑。
groupCalls === truegroupreferences/group-calls.md"meeting"CometChat.initiateCallringing-integration.mdgroup-calls.md平台专属技能负责编写代码;本调度器不编写代码。
如果平台专属技能未加载至Agent上下文(例如用户在v4.1版本前安装了且未重新运行),请告知用户一次:
@cometchat/skillsnpx @cometchat/skills add --family <family>"我已将{family}通话技能安装至您的工作区。请重新运行以继续——您的配置已保存至/cometchat-calls,下次运行将直接进入代码生成步骤,无需再次询问布局问题。".cometchat/config.json
与聊天调度器相同的热重载限制:Agent在会话开始时会快照技能集,会话期间不会重新加载。继续当前会话意味着会根据训练记忆编写通话代码——这是平台专属技能明确禁止的。
Step 7 — Verify
步骤7 — 验证
After the per-family skill writes code, run:
bash
npx @cometchat/skills-cli verify --calls --json(Verifier flag is added in CLI 2.4.0 alongside this dispatcher; it checks for the dual-SDK init, IncomingCall root mount, VoIP push wiring on mobile, and the call trigger / logs placements the user picked.)
--callsIf verify passes, drop the user into the iteration menu — same shape as the chat dispatcher's Step 7, with calls-specific options:
- Add a feature (recording, screen sharing, PiP, in-call chat, custom UI)
- Customize call screen / participant list / control panel
- Set up production auth (server-minted tokens, no Auth Key in calls flow)
- Run diagnostics
平台专属技能编写代码完成后,运行:
bash
npx @cometchat/skills-cli verify --calls --json(验证器标志随本调度器一同在CLI 2.4.0版本中添加;它会检查双SDK初始化、IncomingCall根节点挂载、移动端VoIP推送配置以及用户选择的通话触发按钮/通话记录位置。)
--calls如果验证通过,将用户引导至迭代菜单——与聊天调度器的步骤7格式相同,包含通话专属选项:
- 添加功能(录制、屏幕共享、画中画、通话内聊天、自定义UI)
- 自定义通话界面/参与者列表/控制面板
- 设置生产环境认证(服务器生成令牌,通话流程中不使用Auth Key)
- 运行诊断
Hard rules (every per-family -calls
skill must enforce these)
-calls硬性规则(每个平台专属-calls
技能必须遵守)
-callsThese are the production-grade non-negotiables. The dispatcher checks them in Step 5's plan and the per-family skill is responsible for writing them:
- Dual-SDK contract. Chat SDK does (sends a
initiateCall); Calls SDK doesMessageType.CALL. They are NOT interchangeable. The Android skill leads with this — agents trained on multi-platform CometChat data will conflatejoinSessionwithcom.cometchat.chat.core.Calland write code that compiles but silently breaks.com.cometchat.chat.models.Call - VoIP push wired in standalone mode, not documented. CallKit + PushKit (iOS), ConnectionService + FCM high-priority (Android), (RN),
react-native-callkeep(Flutter). Documentation isn't enough — without working push, missed calls don't ring.flutter_callkit_incoming - Foreground / background lifecycle correct. Android 14+ silently crashes on wrong for ongoing calls; iOS requires CallKit reporting for background audio. Belongs in the
foregroundServiceTypeskill body, not a "see also" reference.-calls - Server-minted auth tokens for the calls path. Production calls flows must use auth tokens, never Auth Key. The skill detects existing token endpoints (same way the chat dispatcher does) and uses .
loginWithAuthToken() - Cleanup on hangup. Camera-light-stays-on / mic-stays-hot is the canonical "looks fine in dev, fails review" bug. Every per-family skill includes the explicit teardown checklist.
- Permissions with rationale. Microphone, camera, screen-record (where supported), notifications. All four, all with usage strings.
- mounted at app root in standalone mode. Not at the chat surface — calls is the whole product, the listener has to be alive everywhere.
IncomingCall
这些是生产环境级别的不可协商规则。调度器会在步骤5的规划中检查这些规则,平台专属技能负责实现:
- 双SDK契约。Chat SDK执行(发送
initiateCall);Calls SDK执行MessageType.CALL。二者不可互换。Android技能以此为核心——接受多平台CometChat数据训练的Agent可能会混淆joinSession与com.cometchat.chat.core.Call,从而编写可编译但静默失效的代码。com.cometchat.chat.models.Call - 独立模式下配置VoIP推送,而非仅提供文档。iOS使用CallKit + PushKit,Android使用ConnectionService + FCM高优先级推送,RN使用,Flutter使用
react-native-callkeep。仅提供文档不够——没有正常工作的推送,未接来电无法响铃。flutter_callkit_incoming - 正确处理前台/后台生命周期。Android 14+若通话时设置错误会静默崩溃;iOS要求CallKit报告后台音频状态。这些内容应包含在
foregroundServiceType技能主体中,而非"另请参阅"参考文档。-calls - 通话流程使用服务器生成的认证令牌。生产环境通话流程必须使用认证令牌,绝不使用Auth Key。技能会检测现有令牌端点(与聊天调度器方式相同)并使用。
loginWithAuthToken() - 通话结束后清理资源。通话结束后摄像头灯保持开启/麦克风保持激活是典型的"开发环境正常,审核失败"问题。每个平台专属技能都包含明确的资源销毁清单。
- 带说明的权限申请。麦克风、相机、屏幕录制(支持的平台)、通知权限。这四项权限均需申请并提供使用说明字符串。
- 独立模式下挂载至应用根节点。而非聊天界面——通话是核心产品,监听器需在全局保持活跃。
IncomingCall
Anti-patterns
反模式
- Don't try to add from this dispatcher. That CLI command is the v4 chat-flow path — it returns the npm install command and that's it. This dispatcher does the actual integration end-to-end. If the user is in
apply-feature callsmode, the chat flow already ran; just enter additive mode here. Never callchat-messaging+voice-videofrom inside this skill.apply-feature calls - Don't load or
cometchat-components(the chat catalogs). Those are chat-shaped. The per-familycometchat-placementskill has its own component list (CallButtons, IncomingCall, OutgoingCall, OngoingCall, CallLogs) and its own placement vocabulary (call trigger, log surface, root listener). Loading the chat catalogs leaks chat assumptions into calls code.-calls - Don't ask the chat archetype question ("Messaging app / Marketplace / SaaS / …"). That taxonomy is for where chat lives. Calls placement is where the call trigger lives + where logs live + whether VoIP push is mandatory. Different vocabulary, different recommendations.
- Don't skip VoIP push in standalone mode even if the user says "I'll add it later." Calls without ringing isn't a product. The dispatcher refuses standalone-mode scaffold without VoIP push wired (or at minimum scaffolded with a clear TODO and red-banner warning in the call screen).
- Don't mix V5 and V6 cohorts (Android, Flutter). The Calls SDK coordinates differ — V5 Android ships as a separate Cloudsmith dep; V6 folds calls into the unified
calls-sdk-androidpackage. Same for Flutter. Readchatuikit-{compose,kotlin}-android/android_versionfromflutter_versionand route to the matching cohort skill..cometchat/config.json
- 请勿尝试从本调度器调用。该CLI命令是v4版本聊天流程的路径——仅返回npm安装命令。本调度器负责端到端的完整集成。如果用户处于
apply-feature calls模式,聊天流程已完成;只需在此处进入附加模式。绝不要在本技能内调用chat-messaging+voice-video。apply-feature calls - 请勿加载或
cometchat-components(聊天组件目录)。这些是围绕聊天场景设计的。平台专属cometchat-placement技能有自己的组件列表(CallButtons、IncomingCall、OutgoingCall、OngoingCall、CallLogs)和布局术语(通话触发入口、记录界面、根监听器)。加载聊天组件目录会将聊天场景的假设引入通话代码。-calls - 请勿询问聊天原型问题("消息应用/电商平台/SaaS/…")。该分类是针对聊天界面的位置。通话布局关注的是通话触发按钮的位置 + 记录界面的位置 + VoIP推送是否为必填项。术语不同,推荐方案也不同。
- 独立模式下请勿跳过VoIP推送,即使用户说"我稍后再添加"。无响铃的通话不具备产品价值。调度器拒绝在未配置VoIP推送(或至少搭建框架并在通话界面添加明确的TODO和红色横幅警告)的情况下进行独立模式框架搭建。
- 请勿混合V5和V6版本(Android、Flutter)。Calls SDK的坐标不同——V5 Android将作为独立的Cloudsmith依赖;V6将通话功能整合至统一的
calls-sdk-android包。Flutter同理。从chatuikit-{compose,kotlin}-android读取.cometchat/config.json/android_version并路由至匹配版本的技能。flutter_version
Ground truth references
基准参考资料
Per-family skills cite from these sources. The dispatcher itself doesn't write code; the per-family skills do. References listed here so a future audit can verify which SDK signatures the skills target.
-calls- Android V5: — pre-authored 17-skill pack at
~/Downloads/calls-sdk/calls-sdk-android-5/, dispatcher atskills/. Folded intoAGENTS.md.cometchat-android-v5-calls/references/{recording,screen-sharing,picture-in-picture,background-handling,voip-calling,audio-controls,video-controls,participant-management,custom-ui,in-call-chat,call-logs,session-settings,event-listeners,join-session,ringing-integration,setup}.md - iOS V5: — sample-app code as ground truth (no pre-authored skill pack).
~/Downloads/calls-sdk/calls-sdk-ios-5/sample-apps/ - JavaScript (web): — sample-app code as ground truth.
~/Downloads/calls-sdk/calls-sdk-javascript-5/sample-apps/ - React Native: — sample-app code as ground truth.
~/Downloads/calls-sdk/calls-sdk-react-native-5/sample-apps/ - Flutter: + existing
~/Downloads/calls-sdk/calls-sdk-flutter-5/sample-apps/andcometchat-flutter-v5-callsskills (audited against the SDK).cometchat-flutter-v6-calls - Angular: Same JS Calls SDK () wrapped in Angular Inputs/Outputs. Sample-app code from
@cometchat/calls-sdk-javascriptplus existing~/Downloads/calls-sdk/calls-sdk-javascript-5/calls section.cometchat-angular-features
平台专属技能引用以下来源。本调度器不编写代码;平台专属技能负责编写。此处列出参考资料以便未来审核技能针对的SDK签名。
-calls- Android V5: ——
~/Downloads/calls-sdk/calls-sdk-android-5/目录下的17个预编写技能包,skills/中的调度器。整合至AGENTS.md。cometchat-android-v5-calls/references/{recording,screen-sharing,picture-in-picture,background-handling,voip-calling,audio-controls,video-controls,participant-management,custom-ui,in-call-chat,call-logs,session-settings,event-listeners,join-session,ringing-integration,setup}.md - iOS V5: ——示例应用代码作为基准(无预编写技能包)。
~/Downloads/calls-sdk/calls-sdk-ios-5/sample-apps/ - JavaScript(Web): ——示例应用代码作为基准。
~/Downloads/calls-sdk/calls-sdk-javascript-5/sample-apps/ - React Native: ——示例应用代码作为基准。
~/Downloads/calls-sdk/calls-sdk-react-native-5/sample-apps/ - Flutter: + 已存在的
~/Downloads/calls-sdk/calls-sdk-flutter-5/sample-apps/和cometchat-flutter-v5-calls技能(已针对SDK审核)。cometchat-flutter-v6-calls - Angular: 基于相同的JS Calls SDK()封装Angular Inputs/Outputs。参考
@cometchat/calls-sdk-javascript中的示例应用代码以及已存在的~/Downloads/calls-sdk/calls-sdk-javascript-5/通话部分。cometchat-angular-features
Three calling modes — pick the right one (Tier 1.8 + 1.9)
三种通话模式——选择合适的模式(Tier 1.8 + 1.9)
CometChat supports three distinct calling workflows. Route the user to the matching per-family reference:
| Mode | Driver | When to use | Per-family ref |
|---|---|---|---|
| Standard | UI Kit ( | 80% case — chat-driven calls with prebuilt UI | covered in per-family |
| Ringing | Chat SDK call entity + Calls SDK session | Custom incoming/outgoing call UI on top of CometChat signaling | |
| Call Session | Calls SDK | Meeting-room URLs, scheduled calls, conference rooms | |
Standard is the default unless the user explicitly says "custom incoming call UI" (→ Ringing) or "meeting link / join with sessionId" (→ Call Session). The Tier 4 use-cases telegraph which mode they want — broadcast + team huddles use Call Session; telehealth + marketplace + support use Standard or Ringing.
CometChat支持三种不同的通话工作流。将用户路由至匹配的平台专属参考文档:
| 模式 | 驱动方式 | 使用场景 | 平台专属参考文档 |
|---|---|---|---|
| 标准模式 | UI Kit( | 80%的场景——聊天驱动的通话,使用预构建UI | 平台专属 |
| 响铃式 | Chat SDK通话实体 + Calls SDK会话 | 在CometChat信令之上自定义来电/去电UI | |
| 通话会话 | 直接使用Calls SDK | 会议室URL、预定通话、会议室 | |
除非用户明确要求"自定义来电UI"(→响铃式)或"会议链接/通过sessionId加入"(→通话会话),否则默认使用标准模式。Tier 4用例会暗示所需模式——直播+团队临时会议使用通话会话;远程医疗+电商平台+客服使用标准模式或响铃式。
Use-case integration patterns (Tier 4)
用例集成模式(Tier 4)
If the user describes their product clearly, route to the matching use-case reference for opinionated CallSettings + UX + compliance callouts:
- Telehealth / virtual visits → — provider/patient flow, two-party consent recording, waiting room, HIPAA notes
references/use-case-telehealth.md - Marketplace (buyer ↔ seller) → — opaque UIDs, time-bounded access, anti-fraud heuristics
references/use-case-marketplace.md - Customer support / help desk → — agent queue, auto-record for QA, post-call CSAT
references/use-case-support.md - Broadcast / webinar / town hall → — locked SIDEBAR, mute-by-default attendees, raise-hand Q&A, RTMP bridge for 100+
references/use-case-broadcast.md - Team huddle / standup / collab → — TILE layout, opt-in join, recording auto-posted to channel
references/use-case-team.md
Each use-case doc covers end-to-end flow + recommended + role-based UI + verification checklist. Apply on top of the per-family skill, don't duplicate the architecture work.
CallSettings-calls如果用户清晰描述其产品,将用户路由至匹配的用例参考文档,获取针对性的CallSettings + UX +合规提示:
- 远程医疗/虚拟问诊 → ——医患流程、双方同意录制、等候室、HIPAA相关说明
references/use-case-telehealth.md - 电商平台(买家↔卖家) → ——匿名UID、限时访问、反欺诈规则
references/use-case-marketplace.md - 客户支持/服务台 → ——客服队列、自动录制用于QA、通话后CSAT评分
references/use-case-support.md - 直播/研讨会/全体大会 → ——锁定侧边栏、参会者默认静音、举手提问、RTMP桥接支持100+人
references/use-case-broadcast.md - 团队临时会议/站会/协作 → ——网格布局、可选加入、录制内容自动发布至频道
references/use-case-team.md
每个用例文档涵盖端到端流程 + 推荐的 + 基于角色的UI + 验证清单。在平台专属技能基础上应用这些内容,请勿重复架构工作。
CallSettings-callsMigration playbooks
迁移指南
For customers upgrading or layering calls on top of an existing chat install, every per-family calls skill ships:
- — Calls SDK v4 → v5 (drop-in replacement; v5 APIs unlock granular event listeners + simpler init)
references/migration-v4-to-v5.md - — additive integration on top of an existing chat surface (init order, login order, IncomingCall mounting, server push setup)
references/add-calls-to-existing-chat.md
Cite the right family. The web reference () is canonical for migration-v4-to-v5 — sister docs in other families add only family-specific deltas.
cometchat-react-calls针对升级或在现有聊天集成基础上添加通话功能的客户,每个平台专属通话技能都提供:
- ——Calls SDK v4 → v5(无缝替换;v5 API支持更细粒度的事件监听器 + 更简单的初始化)
references/migration-v4-to-v5.md - ——在现有聊天界面上进行附加集成(初始化顺序、登录顺序、IncomingCall挂载、服务器推送设置)
references/add-calls-to-existing-chat.md
引用对应平台的文档。Web参考文档()是v4到v5迁移的标准文档;其他平台的文档仅添加平台专属差异内容。
cometchat-react-callsServer-side push templates (Tier 3)
服务器端推送模板(Tier 3)
VoIP push wiring is platform-specific. Three canonical templates ship under per-family :
references/- iOS APNs PushKit (.p8 token auth) —
cometchat-ios-calls/references/server-apns-pushkit.md - Android FCM HTTP v1 (data-only, priority HIGH) — (V6 sister with Compose IncomingCallActivity)
cometchat-android-v5-calls/references/server-fcm-voip.md - Web Push VAPID (best-effort browser ringing) — (Angular sister)
cometchat-react-calls/references/server-web-push-vapid.md
Hybrid platforms (RN, Flutter) ship that routes to the right canonical by / .
references/server-push-bridge.mdPlatform.OSPlatform.is{iOS,Android}VoIP推送配置是平台专属的。三个标准模板在平台专属目录下:
references/- iOS APNs PushKit(.p8令牌认证)——
cometchat-ios-calls/references/server-apns-pushkit.md - Android FCM HTTP v1(仅数据,高优先级)——(V6版本对应Compose IncomingCallActivity)
cometchat-android-v5-calls/references/server-fcm-voip.md - Web Push VAPID(浏览器响铃,尽力而为)——(Angular版本对应文档)
cometchat-react-calls/references/server-web-push-vapid.md
混合平台(RN、Flutter)提供,根据 / 路由至对应标准模板。
references/server-push-bridge.mdPlatform.OSPlatform.is{iOS,Android}What this dispatcher does NOT cover
本调度器未涵盖的内容
- The actual code. Per-family skills write the integration. This dispatcher routes.
-calls - AI-Agent or BYO-Agent flows. Different surface entirely; out of scope. The top-level dispatcher's Step 3.0 routes those to docs.
cometchat - Moderation features for calls (recording-with-consent prompts, profanity filter on in-call chat, etc.). Same status as the chat dispatcher — moderation is dashboard-only.
- Call analytics dashboards — the CometChat dashboard surfaces these, no integration work needed.
- 实际代码编写。平台专属技能负责集成代码编写。本调度器仅负责路由。
-calls - AI-Agent或BYO-Agent流程。完全不同的场景;超出本范围。顶级调度器的步骤3.0会将这些请求路由至文档。
cometchat - 通话 moderation功能(需同意的录制提示、通话内聊天脏话过滤等)。与聊天调度器状态相同——moderation仅通过控制台操作。
- 通话分析仪表盘——CometChat控制台已提供这些功能,无需集成工作。
Pointer back to chat dispatcher
跳转回聊天调度器
If the user invoked directly but the project has no integration at all yet (no , no chat surfaces), and they pick the additive mode by mistake, redirect:
/cometchat-calls.cometchat/config.json"Looks like you don't have CometChat integrated yet. For a calling-first app, that's fine — I'll run the standalone calls flow now. If you want chat alongside, runfirst to set up chat, then come back to add calls."/cometchat
Don't auto-route to from here — it's the user's call (no pun intended) which surface is primary.
cometchat/SKILL.md如果用户直接调用但项目尚未进行任何集成(无,无聊天界面),且错误选择了附加模式,请重定向:
/cometchat-calls.cometchat/config.json"看起来您尚未集成CometChat。如果是构建以通话为核心的应用,没问题——我现在将运行独立通话流程。如果您需要同时集成聊天,请先运行设置聊天功能,再返回添加通话。"/cometchat
请勿从此处自动路由至——由用户决定哪个场景是核心(无意双关)。
cometchat/SKILL.md