publishData method
Publish a new data payload to the room. @param reliable, when true, data will be sent reliably. @param destinationIdentities 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, {
bool? reliable,
List<String>? destinationIdentities,
String? topic,
}) async {
final packet = lk_models.DataPacket(
kind: reliable == true
? lk_models.DataPacket_Kind.RELIABLE
: lk_models.DataPacket_Kind.LOSSY,
user: lk_models.UserPacket(
payload: data,
participantIdentity: identity,
destinationIdentities: destinationIdentities,
topic: topic,
),
);
await room.engine.sendDataPacket(packet);
}