cometchat-native-features
Feature catalog for React Native — calls (separate SDK + WebRTC), extensions (polls / stickers / translation / link preview / collaborative doc / whiteboard / smart replies), AI agent, in-call chat. When to toggle, install, or swap.
cometchat · 已有 AI 审核记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add cometchat/cometchat-skills --skill cometchat-native-features技能说明
name: cometchat-native-features description: "Feature catalog for React Native — calls (separate SDK + WebRTC), extensions (polls / stickers / translation / link preview / collaborative doc / whiteboard / smart replies), AI agent, in-call chat. When to toggle, install, or swap." license: "MIT" compatibility: "Node.js >=18; React Native >=0.70; @cometchat/chat-uikit-react-native ^5" allowed-tools: "executeBash, readFile, fileSearch, listDirectory, AskUserQuestion" metadata: author: "CometChat" version: "3.0.0" tags: "cometchat react-native features calls extensions ai"
Purpose
Teaches Claude how to add features on top of a working CometChat React Native integration. Classifies each feature into one of four types and gives the correct recipe for each.
Read cometchat-native-core + cometchat-native-components + (cometchat-native-expo-patterns or cometchat-native-bare-patterns) first — a base integration must already exist before features layer on.
Ground truth: docs/ui-kit/react-native/core-features.mdx, calling-integration.mdx, call-*.mdx, incoming-call.mdx, outgoing-call.mdx, extensions.mdx, guide-ai-agent.mdx, ai-assistant-chat-history.mdx, and @cometchat/chat-uikit-react-native@5.3.3 exports.
1. Feature taxonomy
Every CometChat feature falls into exactly one of four categories. The category determines the recipe:
| Category | What it means | Example features | How to enable |
|---|---|---|---|
| Default | Already on — no action needed. Shipped with the kit's base components. | Instant messaging, typing indicators, read receipts, reactions on messages, replies, @mentions, media upload, edit/delete, message info | Just render CometChatMessageHeader + CometChatMessageList + CometChatMessageComposer |
| Dashboard-toggle | Flip an extension toggle in the CometChat dashboard (or via the CLI). UI Kit auto-wires the feature once enabled. | Polls, stickers, smart replies, message translation, link previews, collaborative whiteboard, collaborative document, thumbnail generation | Toggle on → hard-reload the app |
| Package-install | Install an additional npm package + maybe native peer deps. The UI Kit auto-detects the package on next init. | Voice + video calls (@cometchat/calls-sdk-react-native) | npm install ... → pod install (iOS) → rebuild |
| Component-swap | Replace or wrap a UI Kit component with a customized version. | Custom text formatter (emoji shortcuts, custom tags), custom message templates, AI Agent chat history | Write a new component + pass via prop |
Reminder — don't confuse these with customization (per-skill-coverage under cometchat-native-customization). This skill is "add a feature that CometChat ships"; customization is "change how an existing feature looks or behaves".
2. Enabling dashboard-toggle features
Most extensions (polls, stickers, translation, link preview, smart replies, collaborative doc, collaborative whiteboard, thumbnails) are dashboard-toggle features. To enable one:
Option A — use the CLI (preferred — no dashboard trip)
npx @cometchat/skills-cli features list --json # browse available features
npx @cometchat/skills-cli features info polls --json # details for one
npx @cometchat/skills-cli features enable polls --json # flip the toggle
The CLI reads the app ID from .cometchat/config.json and the bearer token from the OS keychain (requires a prior cometchat auth login). Response:
"status": "enabled"→ done. Hard-reload (stop Metro + restart + rebuild if on iOS)."status": "no-op"→ already enabled."status": "not-logged-in"→cometchat auth loginfirst."status": "no-app"→ run/cometchatorcometchat provision setupfirst."status": "error"→ surfacenext_steps— includes the dashboard URL as a manual fallback.
Only fall back to the dashboard walkthrough if the CLI errors.
Option B — dashboard (fallback when CLI isn't available)
- https://app.cometchat.com → your app
- Chat & Messaging → Features
- Find the extension by name → flip Status ON
- Hard-reload the RN app (stop Metro, restart, rebuild native if the extension adds native deps — most don't)
What each toggle does
| Extension | UI surface when enabled |
|---|---|
| Polls | Polls option in CometChatMessageComposer's attachment Action Sheet |
| Stickers | Sticker picker in the composer |
| Smart replies | Chip suggestions above the composer input after an incoming message |
| Message translation | "Translate" option in the message long-press menu |
| Link preview | Rich-card bubble for URLs in the message list |
| Collaborative document | Option in composer's Action Sheet; opens a shared doc on tap |
| Collaborative whiteboard | Option in composer's Action Sheet; opens a shared canvas |
| Thumbnail generation | Image / video bubbles show thumbnails instead of full-size downloads |
Gotcha — auto_wired_in_uikit: false
A minority of extensions need extra wiring via UIKitSettingsBuilder.setExtensions([...]) before init. The CLI flags this in its success response:
{
"status": "enabled",
"name": "stickers",
"auto_wired_in_uikit": false,
"next_steps": [
"Register the extension in UIKitSettingsBuilder.setExtensions([...]) before CometChatUIKit.init()"
]
}
If auto_wired_in_uikit is false, import the matching ExtensionsDataSource from @cometchat/chat-uikit-react-native and pass it to the builder:
import {
UIKitSettingsBuilder,
CometChatUIKit,
StickersExtension,
PollsExtension,
} from "@cometchat/chat-uikit-react-native";
const settings = new UIKitSettingsBuilder()
.setAppId(APP_ID)
.setRegion(REGION)
.setAuthKey(AUTH_KEY)
.setExtensions([new StickersExtension(), new PollsExtension()]) // ← new
.subscribePresenceForAllUsers()
.build();
await CometChatUIKit.init(settings);
Query the docs MCP for the exact extension class name if you
阅读完整来源 ↗