Skip to main content

Join an open channel

Join an open channel by creating an OpenChannel instance and calling enterChannel().

note

Use the callback to confirm whether the join operation succeeded. Success means error?.isSuccess == true.

Join an open channel

Method

Dart
Future<int> enterChannel(EnterOpenChannelParams params, ErrorHandler handler)

EnterOpenChannelParams

ParameterTypeDescription
messageCountintNumber of history messages to load when entering the channel.

Code example

Dart
final channel = OpenChannel('<open-channel-id>');
await channel.enterChannel(
EnterOpenChannelParams(messageCount: 20),
(error) {
if (error?.isSuccess == true) {
print('Joined open channel');
}
},
);