createChannel method

Future<NIMResult<ChannelBaseInfo>> createChannel(
  1. {required ChannelType type,
  2. String? channelName,
  3. String? channelExt}
)

创建频道 同一时刻频道名互斥,不能重复创建,但如果频道名缺省,服务器会自动分配频道id。 错误码如下: 10405:频道已存在

type 频道类型 channelName 频道名,可缺省 channelExt 频道的自定义扩展信息,可缺省

Implementation

Future<NIMResult<ChannelBaseInfo>> createChannel(
    {required ChannelType type, String? channelName, String? channelExt}) {
  return _platform.createChannel(
      type: type, channelName: channelName, channelExt: channelExt);
}