sendText method

Future<OnMessage> sendText(
  1. List<String> dests,
  2. String data, {
  3. int maxHoldingSeconds = 8640000,
  4. dynamic noReply = true,
})

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;
  }
}