使用手册

生命周期与错误

一致处理 client ownership、async execution、retry、cancellation 与 shutdown。

Ownership 与 error

在 application service boundary 创建 client,不要每个 request 创建一次。Device session 属于单一 client 且不可比它存活更久。Disconnect 必须容忍 partial connection;重复 shutdown 不应 double-free 或发出两次 terminal event。

所有 package 都区分 invalid argument/state、timeout、authentication、transport、protocol、unsupported capability、platform failure、cancellation、memory exhaustion 与 internal failure。Application telemetry 应保留 stable SDK category;raw HTTP body 只作诊断 context。

Retry、cancel 与 callback

只 retry 明确 idempotent 或可安全重复的 operation,对暂时 transport failure、429 或 5xx 使用 bounded exponential backoff with jitter。没有 idempotency 保证时,不可自动重试 upload authorization、clip delete、device activation 或 command。

将 Kotlin coroutine、Swift Task、Go context、JavaScript AbortSignal 与 native callback 的 cancellation 传到底层。Cancellation 不等于 upload success,应先查询 upload state。Callback payload 若无另行说明,只在 callback 期间有效;UI update 必须切回 platform main thread。

其他手册章節

繼續閱读相关手册章節。

SDK 总览

选择 package 并理解支持边界。

开启章節

开始使用

安装 SDK、设置 client 并完成第一次 request。

开启章節

认证与安全

安全处理 token、PKI、TLS、key 与 media。

开启章節

能力工作流

集成 provisioning、device、telemetry、OTA、command 与 signaling。

开启章節

Video Cloud 工作流

集成 Live WebRTC signaling 与 encrypted stored video。

开启章節

Native C/C++ SDK

使用 stable C ABI、C++ wrapper、transport 与 streaming upload。

开启章節

Android Kotlin SDK

使用 coroutine、signaling、Media3 与 secure key provider。

开启章節

iOS Swift SDK

使用 async API、signaling、AVPlayer、Keychain 与 Secure Enclave。

开启章節

JavaScript/TypeScript SDK

在 browser 与 Node.js 集成 typed ESM package。

开启章節

Go SDK

用 pure Go client 集成 device、tool 与 automation。

开启章節

FreeRTOS/Pro2 SDK

集成 board、transport、media 与 WebRTC answerer adapter。

开启章節

Sample applications

正确使用 Android、iOS、Web、Linux 与 Pro2 sample。

开启章節

调试与兼容性

诊断认证、transport、upload、playback 与版本问题。

开启章節