I’m wondering what I’m doing wrong here or if this is the intended behavior.
I have added 3 event handlers using the code below for 3 unique (isDistinct) channels. Each channel has it’s own event handler registered with a unique channelId.
SendbirdSdk().addChannelEventHandler(chatChannel.channelId, this);
When I send a message using the code below it is received on every registered event handler, so it is received 3 separate times. I would have thought that the message would only be received once, on the event handler that was registered with the channels associated channelId?
void sendMessage(sb.GroupChannel groupChannel, String message, VoidCallback onSend) {
try {
groupChannel.sendUserMessage(
sb.UserMessageParams(message: message),
onCompleted: ((message, error) => {
onSend(),
}),
);
} catch (e) {
// Handle error.
}
}