ChatMessage

public struct ChatMessage

Identify a message from a chat

  • Participant actions related to message

    • typing: User is typing
    • paused: User stop typing
    • active: User enter the chat

    Declaration

    Swift

    public enum ParticipantAction

Enum

  • Message status

    • received: Server has received the message
    • displayed: Remote user read the message
    • waiting: Message is being delivered
    • sent: Message is sent
    • error: Message hasn’t been sent due to an error

    Declaration

    Swift

    public enum Status : String
  • Message body

    • text: A single text message
    • upload: File description and FileUpload instance
    • file: URL where file is hosted and file description

    Declaration

    Swift

    public enum Body

Properties

  • User who sent the message

    Declaration

    Swift

    public let from: String
  • Message content

    Declaration

    Swift

    public let body: Body
  • Message date

    Declaration

    Swift

    public let date: Date
  • Indicate if the message was sent by the local user (false) or was received (true)

    Declaration

    Swift

    public let incomingMessage: Bool
  • Current status for message

    Declaration

    Swift

    public let status: Status
  • Return text associated to message (file description or text message)

    Declaration

    Swift

    public let text: String
  • Receive file updates

    Declaration

    Swift

    public func fileUploadUpdates(_ task: @escaping (ChatFileUpload?) -> Void)

    Parameters

    task

    Task is called everytime FileUpload values changes