ChatMessage
public struct ChatMessage : Codable
Chat message.
-
The id of the message. This id is server generated.
Declaration
Swift
public let id: String -
The message type.
Declaration
Swift
public let type: ChatMessageType -
Sequence of the message in the conversation.
Declaration
Swift
public let sequenceId: String -
Version of the message.
Declaration
Swift
public let version: String -
Content of the message.
Declaration
Swift
public let content: ChatMessageContent? -
The display name of the message sender. This property is used to populate sender name for push notifications.
Declaration
Swift
public let senderDisplayName: String? -
The timestamp when the message arrived at the server. The timestamp is in RFC3339 format:
yyyy-MM-ddTHH:mm:ssZ.Declaration
Swift
public let createdOn: Iso8601Date -
The sender of the message.
Declaration
Swift
public let sender: CommunicationIdentifier? -
The timestamp (if applicable) when the message was deleted. The timestamp is in RFC3339 format:
yyyy-MM-ddTHH:mm:ssZ.Declaration
Swift
public let deletedOn: Iso8601Date? -
The last timestamp (if applicable) when the message was edited. The timestamp is in RFC3339 format:
yyyy-MM-ddTHH:mm:ssZ.Declaration
Swift
public let editedOn: Iso8601Date? -
Optional metadata provided when sending the ChatMessage, data is stringified.
Declaration
Swift
public let metadata: [String : String?]?
-
init(id:type: sequenceId: version: content: senderDisplayName: createdOn: sender: deletedOn: editedOn: metadata: ) Initialize a
ChatMessagestructure.Declaration
Swift
public init( id: String, type: ChatMessageType, sequenceId: String, version: String, content: ChatMessageContent? = nil, senderDisplayName: String? = nil, createdOn: Iso8601Date, sender: CommunicationIdentifier? = nil, deletedOn: Iso8601Date? = nil, editedOn: Iso8601Date? = nil, metadata: [String: String?]? = nil )Parameters
idThe id of the message. This id is server generated.
typeThe chat message type.
sequenceIdSequence of the message in the conversation.
versionVersion of the message.
contentContent of a message.
senderDisplayNameThe display name of the message sender. This property is used to populate sender name for push notifications.
createdOnThe timestamp when the message arrived at the server. The timestamp is in RFC3339 format:
yyyy-MM-ddTHH:mm:ssZ.senderThe sender of the message.
deletedOnThe timestamp (if applicable) when the message was deleted. The timestamp is in RFC3339 format:
yyyy-MM-ddTHH:mm:ssZ.editedOnThe last timestamp (if applicable) when the message was edited. The timestamp is in RFC3339 format:
yyyy-MM-ddTHH:mm:ssZ.
-
Initialize a
ChatMessagestructure from decoderDeclaration
Swift
public init(from decoder: Decoder) throws -
Encode a
ChatMessagestructureDeclaration
Swift
public func encode(to encoder: Encoder) throws
View on GitHub
ChatMessage Structure Reference