createTextMessage static method

Object createTextMessage({
  1. required String userID,
  2. required String text,
  3. String cloudCustomData = "",
  4. String convType = 'C2C',
  5. bool needReadReceipt = false,
  6. int priority = 0,
})

Implementation

static Object createTextMessage(
    {required String userID,
    required String text,
    String cloudCustomData = "",
    String convType = 'C2C',
    bool needReadReceipt = false,
    int priority = 0}) {
  final textParams = {
    "to": userID,
    "needReadReceipt": needReadReceipt,
    "cloudCustomData": cloudCustomData,
    "conversationType": convType,
    "priority": MessagePriorityWeb.convertMsgPriorityToWeb(priority),
    "payload": mapToJSObj({"text": text})
  };
  return mapToJSObj(textParams);
}