joinChannelWithUserAccount method Null safety

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

使用 User Account 加入频道。

Note

  • 该方法不支持相同的用户重复加入同一个频道。
  • 我们建议不同频道中使用不同的 User Account。
  • 如果想要从不同的设备同时接入同一个频道,请确保每个设备上使用的 User Account 是不同的。
  • 请确保用于生成 Token 的 App ID 和创建 RtcEngine 对象时用的 App ID 一致。

Parameter token 在 App 服务器端生成的用于鉴权的 Token。详见从服务端生成 Token

Parameter userAccount 用户 User Account。该参数为必需,最大不超过 255 字节,不可为 null。请确保加入频道的 User Account 的唯一性。 以下为支持的字符集范围(共 89 个字符):

  • 26 个小写英文字母 a-z
  • 26 个大写英文字母 A-Z
  • 10 个数字 0-9
  • 空格
  • "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ","

Parameter options 频道媒体设置选项。详见 ChannelMediaOptions

Implementation

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