createNativeSendMessage static method

Map<String, dynamic> createNativeSendMessage({
  1. required Map<String, dynamic> createdMessage,
  2. required String groupId,
  3. required String userID,
  4. int? priority,
  5. bool? onlineUserOnly,
  6. bool? isExcludedFromUnreadCount,
  7. bool? isExcludedFromLastMessage,
  8. bool? isExcludedFromContentModeration,
  9. bool? needReadReceipt,
  10. Map<String, dynamic>? offlinePushInfo,
  11. String? cloudCustomData,
  12. String? localCustomData,
  13. bool? isSupportMessageExtension = false,
})

Implementation

static Map<String, dynamic> createNativeSendMessage({
  required Map<String, dynamic> createdMessage,
  required String groupId,
  required String userID,
  int? priority,
  bool? onlineUserOnly,
  bool? isExcludedFromUnreadCount,
  bool? isExcludedFromLastMessage,
  bool? isExcludedFromContentModeration,
  bool? needReadReceipt,
  Map<String, dynamic>? offlinePushInfo,
  String? cloudCustomData,
  String? localCustomData,
  bool? isSupportMessageExtension = false,
}) {
  createdMessage['message_conv_type'] = groupId.isEmpty ? 2 : 1;
  createdMessage["message_conv_id"] = groupId.isEmpty ? userID : groupId;
  createdMessage["message_priority"] = priority;
  createdMessage["message_need_read_receipt"] = needReadReceipt ?? false;
  createdMessage["message_is_online_msg"] = onlineUserOnly ?? true;
  createdMessage["message_is_excluded_from_unread_count"] = isExcludedFromUnreadCount ?? false;
  createdMessage["message_excluded_from_last_message"] = isExcludedFromLastMessage ?? false;
  createdMessage["message_cloud_custom_str"] = cloudCustomData ?? "";
  createdMessage["message_custom_str"] = localCustomData ?? "";
  createdMessage["message_offline_push_config"] = offlinePushInfo;
  createdMessage["message_excluded_from_content_moderation"] = isExcludedFromContentModeration ?? true;
  createdMessage["message_is_excluded_from_unread_count"] = isExcludedFromUnreadCount ?? false;
  return createdMessage;
}