CPMessage

@objc
public class CPMessage : FetchedObjects

Abstract base class for accessing common functionality and members of CPInboundMessage and CPOutboundMessage

  • Unique message identifier

    Declaration

    Swift

    @objc
    public internal(set) var messageId: String { get }
  • Time of creation of the message

    Declaration

    Swift

    @objc
    public internal(set) var timestamp: Date { get }
  • Sender of the message

    Declaration

    Swift

    @objc
    public internal(set) var sender: String { get }
  • Recipient of of the message

    Declaration

    Swift

    @objc
    public internal(set) var destination: String { get }
  • Delivery status of the message

    Declaration

    Swift

    @objc
    public internal(set) var status: MessageDeliveryStatus { get }
  • Conversation type sms, chat, or group

    Declaration

    Swift

    @objc
    public internal(set) var conversationType: MessageSessionType { get }
  • Delivery status for group members

    Declaration

    Swift

    @objc
    public internal(set) var groupStatus: [String : String]? { get }
  • The resource url of the conversation

    Declaration

    Swift

    @objc
    public internal(set) var resourceUrl: String { get }
  • Parts of the message. These can be text, file, and json parts.

    Declaration

    Swift

    @objc
    public fileprivate(set) var parts: [CPMessagePart] { get }
  • Read-only interface to get the text part of a message, or empty string if there is no text part

    Declaration

    Swift

    @objc
    public var text: String { get }
  • Public method used to update the internal status of group chat messages

    Declaration

    Swift

    @objc
    public func update(withStatus: CPMessageStatus)

    Parameters

    withStatus

    Message status object used to apply changes to the group

  • Read-only interface to get the files part of a message.

    Declaration

    Swift

    @objc
    public var files: [CPFilePart] { get }
  • Unique identifier by which a conversation may be selected. This may be different depending on conversation type

    Declaration

    Swift

    @objc
    public var conversationID: String { get }
  • Public method for adding file parts to the message.

    Declaration

    Swift

    @objc
    public func addPart(file: CPFilePart)

    Parameters

    file

    FilePart to add to the message