Skip to content

Development Workflow ​

Integrating TiRTC takes work on the device side, the client, and the business backend. Start with this page to see how each side establishes a connection, then go to the specific guide for your current task.

If you only want to run the official demo and see the result quickly, start from Run Sample Projects. When you are ready to integrate TiRTC into your own product, complete the SDK integration and connection steps below.

First Complete SDK Integration and the Connection ​

Steps from SDK integration to implementing features

Audio and video, talkback, and messaging all need an established TiRTC connection. Before implementing them, complete three steps:

  1. Integrate and initialize the SDK. The device and the client each complete the project setup for their target platform, and confirm the SDK initializes or starts normally. During development the client also integrates the log upload entry, so you can upload logs from the same reproduction when you need platform help later.
  2. Prepare the connection conditions. The device starts and becomes connectable. The business backend completes login authentication and device ownership checks, and issues a connection token to the end-user application; trusted Go / Java processes use the SDK Access Key for hosted authentication, and Python can choose either. Both can be prepared at the same time; both must be done before the client initiates the connection.
  3. Establish the connection. The client initiates the connection using the target device's device_id as remote_id. On the client, confirm the result with the connection-established signal for the current platform; on the device side, treat receiving on_conn_accepted(hconn) as confirmation. Only after both sides confirm success can the connection carry audio and video, talkback, and messaging.

After the connection is established, play audio and video, implement voice talkback, or exchange command messages or stream messages as your product needs. These features do not depend on each other: implement one alone or combine them. Different client SDKs support different features, so confirm the applicable platforms before entering a specific guide.

What to Do Next ​

Integrating TiRTC for the First Time ​

If the device or the client has not integrated the SDK yet, start here:

  1. On the device side, complete project setup and start preparation with C SDK Integration.
  2. On the client, complete integration for your platform: Web, Flutter, React Native, Android, iOS, HarmonyOS, Electron, Go client, Java, or Python. If your platform provides client-side diagnostic APIs, also integrate client log upload along the main path of that platform's integration page.
  3. Once both sides are ready, connect the device to complete device startup, the chosen authentication method, and connection confirmation.

Already Connected ​

After the connection succeeds, go straight to the feature you need:

  • Play the audio and video the device sends: Play Audio and Video.
  • Send the client microphone audio to the device, process captured audio before sending it, or feed external PCM: Voice Talkback.
  • Exchange control data carrying a command word between the two sides: Command Messaging.
  • Exchange custom data along a specific stream ID stream_id: Stream Messaging, for Flutter, React Native, Android, HarmonyOS, iOS, Electron, Go, Java, Python, and the C SDK.

Deploying the RTC Service Yourself ​

Only deploy and operate the RTC service yourself when you need a Custom RTC Service. If the client connects to the device directly, skip this part.

Simulating a Device for Joint Debugging ​

When you have no real device, or want to verify the connection and features in a controlled environment first, use the CLI for integration debugging.

Integration Result Not as Expected ​

Follow Troubleshoot Integration Issues step by step, and find the earliest step that did not complete.

What Each Side Needs to Do ​

  • Device side: configure the device identity and start the TiRTC C SDK. The device application captures and encodes media, hands complete media frames to the SDK for transmission, and sends and receives audio and video and messages as the product needs.
  • Client: integrate the SDK for the target platform, connect to the device with a supported authentication method, then implement media receiving, talkback, and messaging. Go, Java, and Python target headless receiving applications and provide no local audio/video input; the application implements playback, rendering, or later frame processing. Other platforms use media output and audio input from the chosen SDK.
  • Business backend: verify the client identity and device ownership, and use application-level credentials to issue a short-lived connection token for the target device that access is granted to. Do not put application-level secrets in untrusted end-user applications or on the device; use hosted authentication only in trusted processes that can store secrets safely.
  • TiRTC: establish and maintain the connection between the two sides, and carry real-time audio and video, commands, and stream messaging over it.

Confirm SDK, Connection, and Feature State ​

SDK startup, connection establishment, and feature availability are three different results, and each needs its own confirmation:

  • The SDK has started. For the C SDK, treat receiving TIRTC_EVENT_SYS_STARTED as confirmation; TiRtcStart() returning 0 only means the start request was accepted. On the client, judge by the result of the initialization API for that platform.
  • The connection has been established. On the client, use the connection-established signal for the current platform; on the device side, treat receiving on_conn_accepted(hconn) as confirmation.
  • The feature is available. Judge by the return values, states, callbacks, and observable results described in the matching guide. A successful connection does not mean subscribing, sending media, playback, or any other feature has completed.

If a step does not reach the result above, handle that step first. Do not troubleshoot subscribing, codec, or rendering while the SDK has not started or the connection has not been established.

TiRTC