stream-unity
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseStream Unity - docs orchestrator for Unity Engine
Stream Unity - Unity Engine 文档编排器
Chat and Video. There is no Stream Feeds SDK for Unity ( and both 404). If the user asks for activity feeds in Unity, say so up front and offer the alternatives (the REST/server API driven from your backend, or a platform SDK on a companion app) rather than inventing an API.
/activity-feeds/docs/unityhttps://getstream.io/cli/docs/activity-feeds-unity.mdThese are two separate SDKs, and almost nothing is shared. Different repos, different install mechanisms, different maturity, different supported platforms, different docs quality. There is no combined client, no shared type ( and are distinct types in distinct assemblies), and connecting a user to one does not connect them to the other. Treat "add chat to my Unity call app" as two integrations that happen to share an API key.
AuthCredentialsStreamChat.Libs.Auth.AuthCredentialsStreamVideo.Libs.Auth.AuthCredentials| Chat | Video | |
|---|---|---|
| Repo | | |
| Latest | v5.7.0 (stable, 5.x line) | 0.11.0 (pre-1.0 - the surface still moves) |
| Install | | UPM package from a git URL |
| Entry point | | |
| Namespace | | |
| Platforms | Everything Unity targets, WebGL included | Android (ARM64), iOS, Windows x64, macOS, Linux. No WebGL, no UWP |
| Pre-built UI | None - a sample project, not components | None - a sample project, not components |
| Docs coverage | Good: nearly every page carries real Unity C# | Thin: 22 pages; several shipped capabilities have no page at all |
Neither SDK ships reusable UI. Both ship a sample project you import and read, not a component library you drop in. Every chat bubble, channel row, participant tile, and call button in the user's game is code you write. Say this before promising a screen, and run when building one.
ui.mdThis skill orchestrates: it gates the request against product, platform, and feature support, routes to the exact docs page, fetches it live, and applies it - while carrying the Unity-specific knowledge the docs do not have (the client's hidden runner, the track-binding requirement, IL2CPP stripping, and the player settings that decide whether a build works on device at all).
DontDestroyOnLoadRules (read once per session): - non-negotiable rules + Unity pitfalls. Read before writing any code.
RULES.mdChat 和 Video。 Unity 没有 Stream Feeds SDK( 和 均为 404)。如果用户询问 Unity 中的 activity feed,请立即说明,并提供替代方案(由后端调用 REST/server API,或在配套应用中使用 platform SDK),而不是虚构 API。
/activity-feeds/docs/unityhttps://getstream.io/cli/docs/activity-feeds-unity.md这是两个独立的 SDK,几乎没有任何共享内容。 它们使用不同的仓库、不同的安装机制、不同的成熟度、不同的受支持平台和不同质量的文档。不存在组合式 client,也不存在共享的 类型( 和 是不同 assembly 中的不同类型),连接到其中一个并不会让用户连接到另一个。将“为我的 Unity call 应用添加 chat”视为两项碰巧共用同一 API key 的集成。
AuthCredentialsStreamChat.Libs.Auth.AuthCredentialsStreamVideo.Libs.Auth.AuthCredentials| Chat | Video | |
|---|---|---|
| 仓库 | | |
| 最新版本 | v5.7.0(稳定版,5.x 系列) | 0.11.0(1.0 之前——API surface 仍可能变化) |
| 安装 | 从 GitHub Releases 获取 | 通过 git URL 安装 UPM package |
| 入口 | | |
| 命名空间 | | |
| 平台 | Unity 支持的所有目标平台,包括 WebGL | Android(ARM64)、iOS、Windows x64、macOS、Linux。不支持 WebGL 和 UWP |
| 预构建 UI | 无——只有示例项目,不是组件 | 无——只有示例项目,不是组件 |
| 文档覆盖 | 良好:几乎每个页面都包含真实的 Unity C# 代码 | 较少:共 22 页;多个已发布的功能完全没有对应页面 |
两个 SDK 都不提供可复用 UI。 两者提供的是一个供你导入并阅读的 sample project,而不是可直接拖入的组件库。用户游戏中的每个 chat bubble、channel row、participant tile 和 call button 都需要自行编写代码。在承诺实现某个界面之前先说明这一点;构建界面时运行 。
ui.md此 skill 负责编排:根据产品、平台和功能支持情况对请求执行 gate,将请求路由到准确的文档页面,实时获取并应用文档,同时补充文档没有的 Unity 专属知识(client 隐藏的 runner、track 绑定要求、IL2CPP stripping,以及决定构建能否在设备上运行的 player settings)。
DontDestroyOnLoad规则(每个 session 读取一次): ——不可违反的规则与 Unity 陷阱。编写任何代码前先阅读。
RULES.mdStep 0: Three gates, before any code
Step 0:编写任何代码前的三个 gate
Resolve all three from the user's words plus a read-only probe. Each one can turn "here is the code" into "that is not possible", so none is optional and none belongs in a runtime failure later.
根据用户措辞和只读 probe 解决以下三个 gate。每一个都可能将“这里有代码”变成“无法实现”,因此全都不可省略,也都不能留到运行时失败后再处理。
Gate 1: product (and whether it exists for Unity)
Gate 1:产品(以及 Unity 是否支持)
| Ask | Answer |
|---|---|
| Chat / messaging / in-game text chat | Supported. Chat SDK. |
| Video calls / audio calls / audio rooms / livestream broadcast | Supported. Video SDK. |
| Both | Two installs, two clients, two connect calls. Do not try to unify them. |
| Activity feeds / timelines / follow graph | No Unity SDK. State it immediately; offer the server API path. |
| Moderation review queue / dashboard UI | Not an app surface. Moderation review happens in the Stream Dashboard; the SDKs expose only end-user actions (flag, mute, ban). |
| 询问 | 答案 |
|---|---|
| Chat / messaging / 游戏内文字聊天 | 支持。使用 Chat SDK。 |
| Video call / audio call / audio room / livestream broadcast | 支持。使用 Video SDK。 |
| 两者都需要 | 两次安装、两个 client、两次 connect 调用。不要尝试将它们统一。 |
| Activity feed / timeline / follow graph | 没有 Unity SDK。 立即说明,并提供 server API 方案。 |
| Moderation review queue / dashboard UI | 不是 app surface。Moderation review 在 Stream Dashboard 中进行;SDK 只提供终端用户操作(flag、mute、ban)。 |
Gate 2: Unity version and build target (the Video SDK is the constraint)
Gate 2:Unity 版本与构建目标(Video SDK 是限制条件)
Probe rather than ask:
bash
bash -c 'echo "=== UNITY VERSION ==="; cat ProjectSettings/ProjectVersion.txt 2>/dev/null; \
echo "=== UPM MANIFEST ==="; cat Packages/manifest.json 2>/dev/null; \
echo "=== STREAM CHAT PRESENT ==="; find . -maxdepth 5 -type d -name "StreamChat" -not -path "*/Library/*" 2>/dev/null; \
echo "=== STREAM VIDEO PRESENT ==="; grep -n "io.getstream.video" Packages/manifest.json 2>/dev/null; \
echo "=== SCRIPTING BACKEND / TARGET ==="; grep -nE "scriptingBackend|AndroidTargetArchitectures|apiCompatibilityLevel|managedStrippingLevel" ProjectSettings/ProjectSettings.asset 2>/dev/null | head -20'| Situation | What to do |
|---|---|
| Unity 6 / 2023.1 / 2022.3 / 2021.3 / 2020.3 | Both SDKs supported. |
| Unity 2019.4 - 2020.2, Chat only | Chat supports it (the SDK advertises 2019.x). Video does not - its package declares |
| Unity 2019.x - 2020.2, Video requested | Hard stop for Video. Say it immediately: upgrade the editor, or ship Chat only. |
| Target is WebGL, Video requested | Hard stop. Unity's WebRTC package does not support WebGL, so neither does the Video SDK. Chat does work on WebGL. Offer: Chat on WebGL plus a browser-based Video client, or drop WebGL. |
| Target is Android, Video requested | ARM64 only. ARMv7 is unsupported and must be disabled. See |
| Target is UWP | Video unsupported. |
| Target is a console | Chat only, and treat it as unverified - the SDK claims console support but publishes no per-console guidance. |
Unity 6 plus Chat carries one hard version floor: Chat v5.4.0 fixed an IL2CPP build crash on Unity (a in IL2CPP's vtable builder). Never pin Chat below v5.4.0 on Unity 6.
6000.0.xKeyNotFoundException执行 probe,而不是直接询问:
bash
bash -c 'echo "=== UNITY VERSION ==="; cat ProjectSettings/ProjectVersion.txt 2>/dev/null; \
echo "=== UPM MANIFEST ==="; cat Packages/manifest.json 2>/dev/null; \
echo "=== STREAM CHAT PRESENT ==="; find . -maxdepth 5 -type d -name "StreamChat" -not -path "*/Library/*" 2>/dev/null; \
echo "=== STREAM VIDEO PRESENT ==="; grep -n "io.getstream.video" Packages/manifest.json 2>/dev/null; \
echo "=== SCRIPTING BACKEND / TARGET ==="; grep -nE "scriptingBackend|AndroidTargetArchitectures|apiCompatibilityLevel|managedStrippingLevel" ProjectSettings/ProjectSettings.asset 2>/dev/null | head -20'| 情况 | 处理方式 |
|---|---|
| Unity 6 / 2023.1 / 2022.3 / 2021.3 / 2020.3 | 两个 SDK 均支持。 |
| Unity 2019.4 - 2020.2,仅使用 Chat | Chat 支持(SDK 声明支持 2019.x)。Video 不支持——其 package 声明 |
| Unity 2019.x - 2020.2,需要 Video | Video 坚决不支持。 立即说明:升级 editor,或仅交付 Chat。 |
| 目标平台为 WebGL,需要 Video | 坚决不支持。 Unity 的 WebRTC package 不支持 WebGL,因此 Video SDK 也不支持。Chat 可以在 WebGL 上运行。提供以下方案:WebGL 上使用 Chat 并搭配基于浏览器的 Video client,或放弃 WebGL。 |
| 目标平台为 Android,需要 Video | 仅支持 ARM64。不支持 ARMv7,必须禁用。见 |
| 目标平台为 UWP | Video 不支持。 |
| 目标平台为 console | 仅支持 Chat,并视为未经验证——SDK 声称支持 console,但没有发布任何针对各 console 的指导。 |
Unity 6 搭配 Chat 时存在一个硬性版本下限:Chat v5.4.0 修复了 Unity 上的 IL2CPP 构建崩溃问题(IL2CPP 的 vtable builder 中会抛出 )。在 Unity 6 上绝不要将 Chat 固定在 v5.4.0 以下。
6000.0.xKeyNotFoundExceptionGate 3: feature support (say no in the plan, not in a compile error)
Gate 3:功能支持(在计划阶段说明不支持,而不是等到编译时报错)
Chat - not implemented client-side as of v5.7.0. If the request needs one of these, say so before writing code:
- Guest and anonymous users (/ anonymous connect do not exist) - this blocks the usual read-only-spectator livestream pattern
ConnectGuestUser - Channel archiving, channel pinning (both are per-member fields with no client API)
- Draft messages, message reminders and bookmarks, location sharing
- User blocking (/
BlockUser/ blocked-user list)UnblockUser - On-demand message translation (auto-translation on a channel does work)
- Setting or a custom status at connect time (
invisibleafter connect works)MarkInvisibleAsync - Unread-mentions-per-channel count; pagination of reactions, watchers, and pinned messages via their dedicated endpoints
- Client-level standalone file upload (channel-level /
UploadFileAsyncwork)UploadImageAsync - Poll answers (text comments) and querying poll votes
Video - not implemented client-side as of 0.11.0:
- Publishing your own screen share. You can receive a remote participant's ; there is no API to start sharing from Unity. The repo README's feature list says "Screensharing" and means the receive half.
ScreenShareTrack - Any incoming-call / ringing event. is handled internally and never surfaced (the source literally reads
call.ring).//StreamTodo: expose CallRinging event?andring: true/AcceptAsyncexist, but the callee has no client-side signal that a call arrived - you need your own push handling.RejectAsync - Push device registration. exists only on an
CreateDeviceAsyncAPI and the low-level client is only reachable through aninternalinterface. Register devices from your backend.internal - A public calling-state machine. is internal; use
CallingState/client.CallStarted/CallLeavingplusCallEnded.client.ActiveCall - Video-side chat integration, deeplinking, picture-in-picture, noise cancellation, transcription control, and HLS/RTMP viewer UI have no Unity docs page. /
GoLiveAsync/StopLiveAsync/StartHLS/StopHLS/StartRecordingAsyncdo ship onStopRecordingAsync- they are undocumented, not absent. Read the interface (rung 2 below) and say where you got it.IStreamCall
Anything server-side stays server-side for both SDKs: call types, channel types, permissions and roles, webhooks, push templates and providers, recording/transcription config, data retention, imports. The client never holds the API secret.
Chat——截至 v5.7.0,client 端尚未实现。 如果请求需要以下功能,请在编写代码之前说明:
- Guest 和 anonymous user(不存在 / anonymous connect)——这会阻断常见的只读 spectator livestream 模式
ConnectGuestUser - Channel archiving、channel pinning(两者都是 per-member field,没有 client API)
- Draft message、message reminder 和 bookmark、location sharing
- User blocking(/
BlockUser/ blocked-user list)UnblockUser - 按需 message translation(channel 的 auto-translation 可以正常使用)
- 在 connect 时设置 或 custom status(connect 后调用
invisible可以实现)MarkInvisibleAsync - 每个 channel 的 unread mention count;通过专用 endpoint 对 reactions、watchers 和 pinned messages 进行分页
- Client 级独立 file upload(channel 级 /
UploadFileAsync可以使用)UploadImageAsync - Poll answer(文本评论)以及查询 poll vote
Video——截至 0.11.0,client 端尚未实现:
- 发布自己的 screen share。 可以接收远程 participant 的 ,但没有 API 可从 Unity 发起 screen share。仓库 README 的功能列表中写着“Screensharing”,指的是接收端能力。
ScreenShareTrack - 任何 incoming-call / ringing event。 在内部处理,永远不会对外暴露(源码中直接写着
call.ring)。//StreamTodo: expose CallRinging event?和ring: true/AcceptAsync存在,但 callee 端没有 client-side signal 表明 call 已到达,需要自行实现 push handling。RejectAsync - Push device registration。 仅存在于
CreateDeviceAsyncAPI 中,而底层 client 只能通过internalinterface 访问。应从后端注册 device。internal - 公开的 calling-state machine。是 internal;请使用
CallingState/client.CallStarted/CallLeaving以及CallEnded。client.ActiveCall - Video-side chat integration、deeplinking、picture-in-picture、noise cancellation、transcription control 和 HLS/RTMP viewer UI 均没有 Unity 文档页面。/
GoLiveAsync/StopLiveAsync/StartHLS/StopHLS/StartRecordingAsync确实由StopRecordingAsync提供——它们只是没有文档,并非不存在。请阅读 interface(下方第 2 级来源),并说明信息来源。IStreamCall
对于两个 SDK,任何 server-side 内容都应保留在 server side:call type、channel type、permission 和 role、webhook、push template 和 provider、recording/transcription config、data retention、import。client 永远不持有 API secret。
The docs convention - and the per-product coverage reality
文档约定——以及各产品的实际覆盖情况
Every Stream docs page has a Markdown twin: take the page URL, drop the trailing , add .
/.mdhttps://getstream.io/chat/docs/unity/query-channels/ -> https://getstream.io/chat/docs/unity/query-channels.md
https://getstream.io/video/docs/unity/basics/quickstart/ -> https://getstream.io/video/docs/unity/basics/quickstart.mdAlways fetch the variant - clean Markdown, verbatim code, no page chrome. Live indexes that list every page:
.md| Product | Live index |
|---|---|
| Chat | |
| Video | |
The two trees fail in opposite directions, so the caveat is different per product.
每个 Stream 文档页面都有一个 Markdown twin:获取页面 URL,移除末尾的 ,然后添加 。
/.mdhttps://getstream.io/chat/docs/unity/query-channels/ -> https://getstream.io/chat/docs/unity/query-channels.md
https://getstream.io/video/docs/unity/basics/quickstart/ -> https://getstream.io/video/docs/unity/basics/quickstart.md始终获取 变体——内容是干净的 Markdown,代码保持原样,不包含页面框架。列出每个页面的实时索引:
.md| 产品 | 实时索引 |
|---|---|
| Chat | |
| Video | |
两棵文档树分别以不同方式存在问题,因此每个产品需要说明的注意事项也不同。
Chat: the code is real, but not every C# block is Unity C#
Chat:代码是真实的,但并非每个 C# block 都是 Unity C#
The Chat Unity tree is well maintained. Roughly 40 of its 53 pages carry a genuine Unity code tab, and where a feature is missing the page usually says so outright:
csharp
// This feature is not yet available in the Unity SDK.The one trap is the fence label, and it is easy to miss because both say C#. These pages mix two different SDKs:
| Fence | Which SDK | Use it? |
|---|---|---|
| The Unity client SDK | Yes. Copy verbatim. |
| The .NET server-side SDK ( | No. It needs the API secret and cannot run in a shipped game. |
label="C#"IStreamChannelchat.SendMessageAsync("channel-type", "channel-id", request)channel.SendNewMessageAsync(request)archiving-channelspinning-channelslocation-sharingsend-messagequery-channelschannel-membersmoderationmessage-delivery-and-read-statuslabel="Unity"message-delivery-and-read-statuschannel.MarkChannelReadAsyncchannel.Readchannel.MarkChannelAsUnreadAsyncmessage.MarkMessageAsLastReadAsyncTwo more Chat-tree facts worth knowing before you fetch:
- The CLI index is incomplete. 15 more paths resolve under - but they 301-redirect to platform or Node docs (
/chat/docs/unity/->push-devices,/docs/platform/push-devices/->chat-permission-policies,/chat/docs/node/...->update-users) and their/docs/platform/users/twins 404. Fetch the/chat/docs/unity/<page>.mdat the redirect target instead, and expect no Unity code there..mdlists them with their real URLs.docs-map.md - The sample-project link in the docs is broken. The introduction page links ; the repo has no
github.com/GetStream/stream-chat-unity/tree/main/...branch. Usemain(or a version tag).develop
Chat Unity 文档树维护良好。其 53 个页面中约有 40 个包含真正的 Unity code tab;如果缺少某项功能,页面通常会直接说明:
csharp
// This feature is not yet available in the Unity SDK.唯一的陷阱是 fence label,而且很容易忽略,因为两者都写着 C#。 以下页面混用了两个 SDK:
| Fence | 对应 SDK | 是否使用? |
|---|---|---|
| Unity client SDK | 是。 原样复制。 |
| .NET server-side SDK( | 否。 它需要 API secret,无法在已发布的游戏中运行。 |
label="C#"IStreamChannelchat.SendMessageAsync("channel-type", "channel-id", request)channel.SendNewMessageAsync(request)archiving-channelspinning-channelslocation-sharingsend-messagequery-channelschannel-membersmoderationmessage-delivery-and-read-statuslabel="Unity"message-delivery-and-read-statuschannel.MarkChannelReadAsyncchannel.Readchannel.MarkChannelAsUnreadAsyncmessage.MarkMessageAsLastReadAsync获取 Chat 文档树之前还需要了解两个事实:
- CLI index 不完整。 下还有 15 个路径可以解析,但它们会 301 重定向到 platform 或 Node 文档(
/chat/docs/unity/->push-devices,/docs/platform/push-devices/->chat-permission-policies,/chat/docs/node/...->update-users),相应的/docs/platform/users/会返回 404。请改为获取重定向目标处的/chat/docs/unity/<page>.md,并预期其中没有 Unity 代码。.md列出了这些页面及其真实 URL。docs-map.md - 文档中的 sample-project link 已失效。 Introduction page 链接到 ,但仓库没有
github.com/GetStream/stream-chat-unity/tree/main/...分支。请改用main或某个 version tag。develop
Video: the code is trustworthy, the tree is just small
Video:代码可信,但文档树很小
All 22 Video Unity pages are Unity-first C# - there is no server-SDK mixing and no JavaScript. The problem is absence: no page covers going live, backstage, HLS, RTMP, recording control, ringing flows, or screen-share receive, even though most of those ship on . When a Video request has no page, that is normal - go to rung 2 and read the interface.
IStreamCallVideo Unity 的全部 22 个页面都以 Unity-first C# 为主——不存在 server SDK 代码混用,也不存在 JavaScript。问题在于缺失:没有页面介绍 going live、backstage、HLS、RTMP、recording control、ringing flow 或 screen-share receive,尽管其中大多数功能都已在 中提供。当 Video 请求没有对应页面时,这属于正常情况——请转到第 2 级来源并阅读 interface。
IStreamCallSource-of-truth ladder
Source-of-truth ladder
Walk it in order. Stop at the first rung that answers the question, and cite which rung you used.
| Rung | Source | Use for |
|---|---|---|
| 1 | The page's | Anything covered. Copy verbatim. |
| 2 | SDK source in the project - | Exact signatures, defaults, nullability, what is |
| 3 | Shipped docs code samples - Chat: | Compiling versions of the snippets behind the docs pages. Often clearer than the page. |
| 4 | Sample projects - Chat: | Real end-to-end wiring, including message-list pooling and participant-view spawning. |
| 5 | Changelogs - Chat: | Behaviour and config that never reached the docs (see |
Read from the version the project actually vendors - Chat is copied into , Video is resolved into , so both are already on disk. Prefer them over GitHub /.
Assets/Library/PackageCache/developmainURL grounding: only fetch a page URL you got from or from a live index fetch in this conversation. Do not invent doc paths from memory.
docs-map.md按顺序检查。在第一个能够回答问题的层级停止,并说明使用了哪一级来源。
| 级别 | 来源 | 用途 |
|---|---|---|
| 1 | 页面中的 | 所有已覆盖的功能。原样复制。 |
| 2 | 项目中的 SDK source—— | 精确 signature、默认值、nullability,以及哪些成员是 |
| 3 | 随包发布的文档代码示例——Chat: | 文档页面背后可编译版本的 snippet。通常比页面本身更清晰。 |
| 4 | Sample project——Chat: | 真实的端到端接线,包括 message-list pooling 和 participant-view spawning。 |
| 5 | Changelog——Chat: | 从未进入文档的行为和配置(见 |
应读取项目实际使用的版本——Chat 被复制到 中,Video 被解析到 中,因此两者都已经位于本地磁盘。优先使用它们,而不是 GitHub 上的 /。
Assets/Library/PackageCache/developmainURL grounding: 只获取来自 或本次对话中实时索引的页面 URL。不要凭记忆虚构文档路径。
docs-map.mdStep 1: Classify the request
Step 1:对请求进行分类
With the gates passed, pick the mode:
- How-to / reference ("how do I query channels?", "what does do?") -> go straight to Docs lookup. No setup, no credentials.
SetIncomingVideoEnabled - Integrate ("add chat to my game", "put a video call in this project") -> run , then Docs lookup per feature.
setup.md - New project ("build me a Unity chat app") -> then Docs lookup, scoped to the requested screens. If there is no Unity project (no
setup.md), tell the user to create it in Unity Hub first - do not try to synthesize a Unity project tree by hand.ProjectSettings/ProjectVersion.txt - UI work ("show a channel list", "render the participants", "style the message bubbles", "add call controls") -> run . Neither SDK ships components, so this is code you write; the runbook carries the prefab/pooling patterns, the track-binding contract, and the self-preview path that has no track.
ui.md - Build / ship / run on device ("build for Android", "why is there no video on my phone?", "IL2CPP build crashes", "package for iOS") -> run . The player settings there are load-bearing, not polish: without them an Android Video build has no working WebRTC, an iOS build never gets camera permission, and an IL2CPP build can strip the SDK's serialization types.
platforms.md - Upgrade / migrate a version ("bump Chat to 5.7", "we're on 4.x") -> Chat 4.x -> 5.x is the enum-to-struct migration; read from
migration-guide-to-5x.md. For Video, there is no migration guide - readdocs-map.mdbetween the two versions and say plainly that a pre-1.0 SDK can break API between minors.CHANGELOG.md
通过三个 gate 后,选择模式:
- How-to / reference(“如何查询 channel?”、的作用是什么?)-> 直接进入 Docs lookup。无需 setup,也不需要 credentials。
SetIncomingVideoEnabled - Integrate(“为我的游戏添加 chat”、“在这个项目中加入 video call”)-> 运行 ,然后针对每项功能执行 Docs lookup。
setup.md - New project(“为我构建一个 Unity chat app”)-> 先运行 ,再执行 Docs lookup,并限定在用户请求的界面范围内。如果不存在 Unity project(没有
setup.md),请告诉用户先在 Unity Hub 中创建项目——不要尝试手工合成 Unity project tree。ProjectSettings/ProjectVersion.txt - UI work(“显示 channel list”、“渲染 participant”、“设置 message bubble 样式”、“添加 call control”)-> 运行 。两个 SDK 都不提供 component,因此需要自行编写代码;runbook 中包含 prefab/pooling 模式、track-binding contract,以及没有 track 的 self-preview path。
ui.md - Build / ship / run on device(“构建 Android 版本”、“为什么手机上没有 video”、“IL2CPP 构建崩溃”、“打包 iOS”)-> 运行 。其中的 player settings 至关重要,并非锦上添花:缺少这些设置,Android Video build 将无法使用 WebRTC,iOS build 永远无法获得 camera permission,IL2CPP build 还可能 strip SDK 的 serialization type。
platforms.md - Upgrade / migrate version(“将 Chat 升级到 5.7”、“我们还在 4.x”)-> Chat 4.x -> 5.x 是 enum-to-struct migration;从 读取
docs-map.md。Video 没有 migration guide——请对比两个版本之间的migration-guide-to-5x.md,并明确说明 pre-1.0 SDK 的 API 可能在 minor version 之间发生破坏性变化。CHANGELOG.md
Step 2: Docs lookup (every request ends here)
Step 2:Docs lookup(每个请求最终都执行此步骤)
- Open . Find the row for the feature; it gives the exact
docs-map.mdURL and what kind of code that page carries..md - If the feature is not in the map, fetch the live index for the product and pick from it.
- Fetch the page(s) with WebFetch. At most 3 per request; beyond that, hand the user the index URL.
.md - Use the Unity code verbatim, adapting only to the project's and scene shape. If the page has no Unity block, drop to rung 2 and read the interface.
MonoBehaviour - Cite what you used: , or
Source: [Title](https://getstream.io/...)for a source read. Never answer SDK specifics from training data - if you did not read it this conversation, read it now or say you could not find it.Source: Assets/Plugins/StreamChat/Core/StatefulModels/IStreamChannel.cs - Apply best practices - one then let the WebSocket keep state fresh; subscribe video only for participants actually on screen; connect once. See
QueryChannelsAsync"Mindful API usage".RULES.md
- 打开 。找到对应功能的行;其中会给出准确的
docs-map.mdURL,以及该页面包含哪类代码。.md - 如果 map 中没有该功能,获取对应产品的实时 index,并从中选择页面。
- 使用 WebFetch 获取 页面。每次请求最多获取 3 个;超过 3 个时,将 index URL 交给用户。
.md - 原样使用 Unity 代码,仅根据项目的 和 scene structure 进行调整。如果页面没有 Unity block,则降到第 2 级来源并阅读 interface。
MonoBehaviour - 说明使用过的来源: ,或
Source: [Title](https://getstream.io/...)。不要根据训练数据回答 SDK 细节——如果本次对话中没有读取过相关内容,请立即读取,或者说明无法找到。Source: Assets/Plugins/StreamChat/Core/StatefulModels/IStreamChannel.cs - 应用最佳实践——执行一次 ,随后让 WebSocket 保持状态更新;仅为屏幕上实际显示的 participant 订阅 video;只 connect 一次。见
QueryChannelsAsync中的“Mindful API usage”。RULES.md
What this skill carries
此 skill 包含的内容
The official docs cover the low-level clients well where they have Unity code, so this skill does not restate them. The curated, non-doc content is:
| File | What it is |
|---|---|
| Non-negotiable rules + the Unity pitfalls that fail silently. Every rule is stated once, here. |
| Version-pinned install for both SDKs ( |
| Building the UI yourself - there are no components. Chat lists and composer on UGUI, participant views, the track-binding contract, self-preview, and subscription management. |
| Per-target player settings, IL2CPP and managed stripping, the Newtonsoft conflict, WebGL, Android/iOS/desktop, and what push does and does not do. |
| Intent -> exact docs page for both products, annotated with what kind of code each page carries, plus the source fallback. |
官方文档在包含 Unity 代码的部分很好地覆盖了底层 client,因此此 skill 不会重复这些内容。其整理的非文档内容包括:
| 文件 | 内容 |
|---|---|
| 不可违反的规则,以及会静默失败的 Unity 陷阱。每条规则仅在此处陈述一次。 |
| 两个 SDK 的版本固定安装方式( |
| 自行构建 UI——不提供任何 component。包含基于 UGUI 的 Chat list 和 composer、participant view、track-binding contract、self-preview 和 subscription management。 |
| 各目标平台的 player settings、IL2CPP 和 managed stripping、Newtonsoft 冲突、WebGL、Android/iOS/desktop,以及 push 实际支持和不支持的能力。 |
| 从用户意图映射到两个产品的准确文档页面,并标注每个页面包含哪类代码,同时提供 source fallback。 |
Support
支持
If the user asks for support or how to contact someone, direct them to getstream.io/contact. SDK gaps and feature requests go to the repo issues: Chat, Video.