joinChannelWithUserAccount method Null safety

Future<void> joinChannelWithUserAccount(
  1. String? token,
  2. String userAccount,
  3. ChannelMediaOptions options
)

Joins a channel with the user account.

Note

  • If you are already in a channel, you cannot rejoin it with the same uid.
  • We recommend using different user accounts for different channels.
  • If you want to join the same channel from different devices, ensure that the user accounts in all devices are different.
  • Ensure that the app ID you use to generate the token is the same with the app ID used when creating the RtcEngine instance.

Parameter token The token generated at your server. Set it as the token generated at your server. For details, see Get a token.

Parameter userAccount The user account. The maximum length of this parameter is 255 bytes. Ensure that you set this parameter and do not set it as null.

  • 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: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",".

Parameter options The channel media options. See ChannelMediaOptions.

Implementation

@override
Future<void> joinChannelWithUserAccount(
    String? token, String userAccount, ChannelMediaOptions options) {
  return _invokeMethod('joinChannelWithUserAccount', {
    'token': token,
    'userAccount': userAccount,
    'options': options.toJson(),
  });
}