onRoomMessageReceived method
@detail callback
@brief Receive a callback for broadcast messages in the room.
This callback is received when other users in the room call sendRoomMessage{@link #RTSRoom#sendRoomMessage} to send a broadcast message.
@param uid User ID of the message sender.
@param message The content of the received message.
Implementation
FutureOr<void> onRoomMessageReceived(
dynamic msgid, dynamic uid, dynamic message) async {
if ($instance == null || $instance is! IRTSRoomEventHandler) {
return;
}
return ($instance as IRTSRoomEventHandler).onRoomMessageReceived?.call(
int.tryParse(msgid.toString()) ?? 0,
uid.toString(),
message.toString());
}