createCustomMessage static method

Object createCustomMessage({
  1. required String userID,
  2. required String customData,
  3. int priority = 0,
  4. String convType = 'C2C',
  5. String description = '',
  6. String cloudCustomData = '',
  7. bool needReadReceipt = false,
  8. String extension = '',
})

Implementation

static Object createCustomMessage(
    {required String userID,
    required String customData,
    int priority = 0,
    String convType = 'C2C',
    String description = '',
    String cloudCustomData = '',
    bool needReadReceipt = false,
    String extension = ''}) {
  final customParams = {
    "to": userID,
    "conversationType": convType,
    "cloudCustomData": cloudCustomData,
    "needReadReceipt": needReadReceipt,
    "priority": MessagePriorityWeb.convertMsgPriorityToWeb(priority),
    "payload": mapToJSObj({
      "data": customData,
      "description": description,
      "extension": extension
    })
  };

  return mapToJSObj(customParams);
}