tencent cloud

Tencent Real-Time Communication

お知らせ・リリースノート
製品アップデート情報
Tencent Cloudオーディオビデオ端末SDKの再生アップグレードおよび承認チェック追加に関するお知らせ
TRTCアプリケーションのサブスクリプションパッケージサービスのリリースに関する説明について
製品の説明
製品概要
基礎概念
製品の機能
製品の強み
ユースケース
性能データ
購入ガイド
Billing Overview
無料時間の説明
Monthly subscription
Pay-as-you-go
TRTC Overdue and Suspension Policy
課金に関するよくあるご質問
Refund Instructions
初心者ガイド
Demo体験
Call
コンポーネントの説明(TUICallKit)
Activate the Service
Run Demo
クイック導入
オフライン通知
Conversational Chat
クラウドレコーディング(TUICallKit)
AI Noise Reduction
インターフェースのカスタマイズ
Calls integration to Chat
Additional Features
No UI Integration
Server APIs
Client APIs
Solution
ErrorCode
公開ログ
よくある質問
ライブ配信
Billing of Video Live Component
Overview
Activating the Service (TUILiveKit)
Demo のクイックスタート
No UI Integration
UI Customization
Live Broadcast Monitoring
Video Live Streaming
Voice Chat Room
Advanced Features
Client APIs
Server APIs
Error Codes
Release Notes
FAQs
RTC Engine
Activate Service
SDKのダウンロード
APIコードサンプル
Usage Guidelines
クライアント側 API
高度な機能
RTC RESTFUL API
History
Introduction
API Category
Room Management APIs
Stream mixing and relay APIs
On-cloud recording APIs
Data Monitoring APIs
Pull stream Relay Related interface
Web Record APIs
AI Service APIs
Cloud Slicing APIs
Cloud Moderation APIs
Making API Requests
Call Quality Monitoring APIs
Usage Statistics APIs
Data Types
Appendix
Error Codes
コンソールガイド
アプリケーション管理
使用統計
監視ダッシュボード
開発支援
Solution
Real-Time Chorus
よくあるご質問
課金関連問題
機能関連
UserSig関連
ファイアウォールの制限の対応関連
インストールパッケージの圧縮に関するご質問
AndriodおよびiOS関連
Web端末関連
Flutter関連
Electron関連
TRTCCalling Web関連
オーディオビデオ品質関連
その他のご質問
旧バージョンのドキュメント
TUIRoom(Web)の統合
TUIRoom (Android)の統合
TUIRoom (iOS)の統合
TUIRoom (Flutter)の統合
TUIRoom (Electron)の統合
TUIRoom APIのクエリー
クラウドレコーディングと再生の実現(旧)
Protocols and Policies
セキュリティコンプライアンス認証
セキュリティホワイトペーパー
情報セキュリティの説明
Service Level Agreement
Apple Privacy Policy: PrivacyInfo.xcprivacy
TRTC ポリシー
プライバシーポリシー
データ処理とセキュリティ契約
用語集

CoGuestStore

PDF
フォーカスモード
フォントサイズ
最終更新日: 2026-03-05 16:32:08

Introduction

Co-guest feature enables real-time interaction between hosts and audience members through a seat-based system. CoGuestStore provides a comprehensive set of APIs to manage the entire co-guest lifecycle.
Important:
Always use the factory method CoGuestStore.create with a valid live room ID to create a CoGuestStore instance. Do not attempt to initialize directly.
Note:
Co-guest state updates are delivered through the coGuestState publisher. Subscribe to it to receive real-time updates about connected users, invitations and applications.
Warning:
If a co-guest request does not receive a response within the specified timeout, an event with NoResponseReason.timeout will be triggered. Always handle timeout scenarios in your UI.

Features

Bidirectional Invitation:Hosts can invite audience members, and audience members can also apply to join
State Management:Real-time tracking of connected users, invitations and applications
Event-Driven Architecture:Provides separate event streams for host and guest roles
Timeout Handling:Built-in timeout mechanism for invitations and applications

Subscribable Data

CoGuestState fields are described below:
Property
Type
Description
connected
ValueListenable<List<SeatUserInfo>>
List of users already on seats.
invitees
ValueListenable<List<LiveUserInfo>>
List of users invited by host.
applicants
ValueListenable<List<LiveUserInfo>>
List of users who applied for co-guest received by host.
candidates
ValueListenable<List<LiveUserInfo>>
List of candidate users for co-guest.

API List

Function
Description
Create object instance.
Host-side event callbacks.
Host-side event callbacks.
Guest-side event callbacks.
Guest-side event callbacks.
Guest applies for co-guest.
Guest cancels application.
Host accepts application.
Host rejects application.
Host invites guest to co-guest.
Host cancels invitation.
Guest accepts invitation.
Guest rejects invitation.
End co-guest session.

Creating Instance

CoGuestStore.create

Create object instance

Observing State and Events

addHostListener

Add host-side event callback listener
void addHostListener(HostListener listener);
Version
Supported since version 3.5.
Parameters
Parameter
Type
Required
Description
listener
Required
Listener.

removeHostListener

Remove host-side event callback listener
void removeHostListener(HostListener listener);
Version
Supported since version 3.5.
Parameters
Parameter
Type
Required
Description
listener
Required
Listener.

addGuestListener

Add guest-side event callback listener
void addGuestListener(GuestListener listener);
Version
Supported since version 3.5.
Parameters
Parameter
Type
Required
Description
listener
Required
Listener.

removeGuestListener

Remove guest-side event callback listener
void removeGuestListener(GuestListener listener);
Version
Supported since version 3.5.
Parameters
Parameter
Type
Required
Description
listener
Required
Listener.

Guest Operations

applyForSeat

Apply to go on seat
Future<CompletionHandler> applyForSeat({
required int seatIndex,
required int timeout,
String? extraInfo,
});
Request to join co-guest session as an audience member. After calling this method, a co-guest request is sent to all hosts in the live room. The request will remain active until: • Host accepts via acceptApplication • Host rejects via rejectApplication • Timeout expires • You cancel via cancelApplication
Version
Supported since version 3.5.
Notes
Note:
If no host responds within the timeout, {ref2} event with NoResponseReason.timeout will be triggered.
Parameters
Parameter
Type
Required
Description
seatIndex
int
Required
Seat index, -1 means auto-assign seat.
timeout
int
Required
Timeout (unit: seconds).
extraInfo
String?
Required
Extra information.

cancelApplication

Cancel seat application
Future<CompletionHandler> cancelApplication();
Cancel a previously sent co-guest application. After calling this method, all hosts will be notified of the application cancellation.
Version
Supported since version 3.5.
Notes
Note:
If the application has already been processed by a host, the cancellation may have no effect.

acceptApplication

Accept seat application
Future<CompletionHandler> acceptApplication(String userID);
Version
Supported since version 3.5.
Parameters
Parameter
Type
Required
Description
userID
String
Required
User ID.

rejectApplication

Reject seat application
Future<CompletionHandler> rejectApplication(String userID);
Version
Supported since version 3.5.
Parameters
Parameter
Type
Required
Description
userID
String
Required
User ID.

Host Operations

inviteToSeat

Invite audience to seat
Future<CompletionHandler> inviteToSeat({
required String inviteeID,
required int seatIndex,
required int timeout,
String? extraInfo,
});
Version
Supported since version 3.5.
Parameters
Parameter
Type
Required
Description
inviteeID
String
Required
Invited user ID.
seatIndex
int
Required
Seat index, -1 means auto-assign seat.
timeout
int
Required
Timeout (unit: seconds).
extraInfo
String?
Required
Extra information.

cancelInvitation

Cancel seat invitation
Future<CompletionHandler> cancelInvitation(String inviteeID);
Version
Supported since version 3.5.
Parameters
Parameter
Type
Required
Description
inviteeID
String
Required
Invited user ID.

acceptInvitation

Accept seat invitation
Future<CompletionHandler> acceptInvitation(String inviterID);
Version
Supported since version 3.5.
Parameters
Parameter
Type
Required
Description
inviterID
String
Required
Inviter user ID.

rejectInvitation

Reject seat invitation
Future<CompletionHandler> rejectInvitation(String inviterID);
Version
Supported since version 3.5.
Parameters
Parameter
Type
Required
Description
inviterID
String
Required
Inviter user ID.

Connection Control

disconnect

End co-guest session

Data Structures

NoResponseReason

Reason for no response to co-guest invitation sent by host or co-guest request initiated by audience
Enum Value
Value
Description
timeout
0
Request timeout.
alreadySeated
1
User already on seat.

HostListener

Callback events received on host side
Methods
Method
Description
onGuestApplicationReceived
This callback is triggered when an audience applies for co-guest.
onGuestApplicationCancelled
This callback is triggered when an audience cancels co-guest application.
onGuestApplicationProcessedByOtherHost
This callback is triggered when an audience's co-guest application is processed by another host.
onHostInvitationResponded
This callback is triggered when a co-guest invitation sent by host receives a response from audience.
onHostInvitationNoResponse
This callback is triggered when a co-guest invitation sent by host receives no response.

GuestListener

Callback events received on guest side
Methods
Method
Description
onHostInvitationReceived
This callback is triggered when receiving a co-guest invitation from host.
onHostInvitationCancelled
This callback is triggered when host cancels co-guest invitation.
onGuestApplicationResponded
This callback is triggered when audience's co-guest application receives a response from host.
onGuestApplicationNoResponse
This callback is triggered when audience's co-guest application receives no response.
onKickedOffSeat
This callback is triggered when audience is kicked off seat by host.

CoGuestState

Co-guest related state data provided externally by CoGuestStore
Property
Type
Description
connected
ValueListenable<List<SeatUserInfo>>
List of users already on seats.
invitees
ValueListenable<List<LiveUserInfo>>
List of users invited by host.
applicants
ValueListenable<List<LiveUserInfo>>
List of users who applied for co-guest received by host.
candidates
ValueListenable<List<LiveUserInfo>>
List of candidate users for co-guest.

Usage Example

// Create store instance
final store = CoGuestStore.create('live_room_123');

// Define listeners
late final VoidCallback connectedListener = _onConnectedChanged;
late final VoidCallback applicantsListener = _onApplicantsChanged;

void _onConnectedChanged() {
print('Connected users: ${store.coGuestState.connected.value.length}');
}

void _onApplicantsChanged() {
print('Pending applications: ${store.coGuestState.applicants.value.length}');
}

// Subscribe to state changes
store.coGuestState.connected.addListener(connectedListener);
store.coGuestState.applicants.addListener(applicantsListener);

// Add host event listener (for hosts)
final hostListener = HostListener(
onGuestApplicationReceived: (guestUser) {
print('Received application from ${guestUser.userName}');
// Show accept/reject UI
},
onHostInvitationResponded: (isAccept, guestUser) {
print('Audience ${guestUser.userName} ${isAccept ? "accepted" : "rejected"}');
},
);
store.addHostListener(hostListener);

// Host: Accept application
final result = await store.acceptApplication('user_456');
if (result.code == 0) {
print('Application accepted successfully');
}

// Unsubscribe when done
store.coGuestState.connected.removeListener(connectedListener);
store.coGuestState.applicants.removeListener(applicantsListener);
store.removeHostListener(hostListener);

ヘルプとサポート

この記事はお役に立ちましたか?

フィードバック