publishData method
Publish a new data payload to the room. @param destinationSids When empty, data will be forwarded to each participant in the room. @param topic, the topic under which the message gets published.
Implementation
Future<void> publishData(
List<int> data, {
Reliability reliability = Reliability.reliable,
List<String>? destinationSids,
String? topic,
}) async {
final packet = lk_models.DataPacket(
kind: reliability.toPBType(),
user: lk_models.UserPacket(
payload: data,
participantSid: sid,
destinationSids: destinationSids,
topic: topic,
),
);
await room.engine.sendDataPacket(packet);
}