createLocationMessage static method

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

Implementation

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