joinChannel method

  1. @override
Future<ResultCode> joinChannel(
  1. String token,
  2. String channelId,
  3. String userId, {
  4. RtcChannelConfig? config,
})
override

Join the channel.

Parameter token The secure token that App Server got from PANO.

Parameter channelId The channel ID defined by customer. It must compliance with the following rules:

  • max length is 128 bytes.
  • characters can be "0-9", "a-z", "A-Z", whitespace (cannot at leading and trailing), "!", "#", "$", "%", "&", "(", ")", "+", ",", "-", ".", ":", ";", "<", "=", ">", "?", "@", "", "", "^", "_", "|", "~".

Parameter userId The user ID defined by customer. It must be unique.

Parameter config Channel configurations. (Optional)

Returns

Note Join only one channel at a time. User need to check the callback onUserJoinIndication to see if join channel result.

加入频道。

Parameter token 应用服务器从PANO获得的安全令牌。

Parameter channelId 客户定义的频道标识。必须符合以下规则:

  • 最大长度是128字节;
  • 只能由以下字符构成: "0-9", "a-z", "A-Z", 空格 (不能出现在首部和尾部), "!", "#", "$", "%", "&", "(", ")", "+", ",", "-", ".", ":", ";", "<", "=", ">", "?", "@", "", "", "^", "_", "|", "~"。

Parameter userId 客户定义的用户标识。必须是唯一的。

Parameter config 频道设置。(可选)

Returns

Note 同一时刻只能加入一个频道。 用户需检查回调函数 onUserJoinIndication 获知加会结果。

Implementation

@override
Future<ResultCode> joinChannel(String token, String channelId, String userId,
    {RtcChannelConfig? config}) {
  config ??= RtcChannelConfig();
  return _invokeCodeMethod('joinChannel', {
    'token': token,
    'channelId': channelId,
    'userId': userId,
    'config': config.toJson()
  });
}