joinChannel abstract method
- String? token,
- String? optionalInfo,
- int optionalUid,
- ChannelMediaOptions options,
Joins the channel with a user ID. Once the user joins the channel, the user subscribes to the audio and video streams of all the other users in the channel by default, giving rise to usage and billing calculation. If you do not want to subscribe to a specified stream or all remote streams, call the mute methods accordingly. If you are already in a channel, you cannot rejoin it with the user ID. We recommend using different UIDs for different channels. If you want to join the same channel from different devices, ensure that the user IDs in all devices are different.
Param options
The channel media options.
Param optionalInfo
Reserved for future use.
Param token
The token generated on your server for authentication. See Authenticate Your Users with Token.
Ensure that the App ID used for creating the token is the same App ID used by the createWithContext method for initializing the RTC engine.
Param optionalUid
User ID. This parameter is used to identify the user in the channel for real-time audio and video interaction. You need to set and manage user IDs yourself, and ensure that each user ID in the same channel is unique. This parameter is a 32-bit unsigned integer with a value ranging from 1 to 232 -1. If the user ID is not assigned (or set as 0), the SDK assigns a user ID and reports it in the joinChannelSuccess callback. Your app must maintain this user ID.
Implementation
Future<void> joinChannel(String? token, String? optionalInfo, int optionalUid,
ChannelMediaOptions options);