switchChannel method

  1. @override
Future<void> switchChannel(
  1. String? token,
  2. String? channelName
)

Switches to a different channel.

This method allows the audience of a ChannelProfile.LiveBroadcasting channel to switch to a different channel. After the user successfully switches to another channel, the RtcEngineEventHandler.leaveChannel and RtcEngineEventHandler.joinChannelSuccess callbacks are triggered to indicate that the user has left the original channel and joined a new one.

Note

Parameter token token Parameter channelName Unique channel name for the arRTC session in the string format. The string length must be less than 64 bytes. Supported character scopes are:

  • All lowercase English letters: a to z.
  • All uppercase English letters: A to Z.
  • All numeric characters: 0 to 9.
  • The space character.
  • Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "", "", "^", "_", " {", "}", "|", "~", ",".

Implementation

@override
Future<void> switchChannel(String? token, String? channelName) {
  return _invokeMethod(
      'switchChannel', {'token': token, 'channelName': channelName});
}