sendText method
sendText sends bytes or string data to one or multiple destinations with an
optional config. Returned OnMessage
will emit if a reply or ACK for
this message is received.
Implementation
Future<OnMessage> sendText(List<String> dests, String data, {int maxHoldingSeconds = 8640000, noReply = true}) async {
try {
final Map resp = await _methodChannel.invokeMethod('sendText', {
'_id': this.address,
'dests': dests,
'data': data,
'noReply': noReply,
'maxHoldingSeconds': maxHoldingSeconds,
});
OnMessage message = OnMessage(
messageId: resp['messageId'],
data: resp['data'],
type: resp['type'],
encrypted: resp['encrypted'],
src: resp['src'],
noReply: resp['noReply'],
);
return message;
} catch (e) {
rethrow;
}
}