Open channel status handler
Listen for status changes
Register an OpenChannelHandler to receive open channel status and participant change events.
Dart
NCEngine.addOpenChannelHandler('open-handler', OpenChannelHandler(
onStatusChanged: (event) {
print('Open channel ${event.channelId} status: ${event.status}');
},
onParticipantChanged: (event) {
print(
'Member change in ${event.channelId}: ${event.actions}, count: ${event.participantCount}',
);
},
onParticipantMuted: (event) {
print('Member muted: ${event.info?.userIdList}');
},
onParticipantBanned: (event) {
print('Member banned: ${event.info?.userIdList}');
},
onNotifyMultiLoginSync: (event) {
print('Multi-device sync: $event');
},
));
Remove the handler when it is no longer needed:
Dart
NCEngine.removeOpenChannelHandler('open-handler');
Listen for participant changes
Enable the service
Enable Enable auto messaging for participant events in the Nexconn console under Chat > Chat settings > Open Channels. Once enabled, the system sends notifications to other participants when a user joins or leaves.
Use the onParticipantChanged callback in OpenChannelHandler (see above).