CPConversation

@objc
public class CPConversation : FetchedObjects

This is an abstract base class used to access the common functionality and members of a MessageService conversation.

  • Undocumented

    Declaration

    Swift

    @objc
    public internal(set) var fromAddress: String { get }
  • Remote party with which the conversation is made

    Declaration

    Swift

    @objc
    public private(set) var participant: String { get }
  • The last text message exchanged between the conversation parties

    Declaration

    Swift

    @objc
    public internal(set) var lastText: String { get }
  • Timestamp of the first message in this conversation

    Declaration

    Swift

    @objc
    public internal(set) var firstMessageTime: Date { get }
  • Timestamp of the last message in this conversation

    Declaration

    Swift

    @objc
    public internal(set) var lastMessageTime: Date { get }
  • Timestamp of the last message received by this party

    Declaration

    Swift

    @objc
    public internal(set) var lastReceivedMessageTime: Date { get }
  • Timestamp of the most recent fetch of the conversation

    Declaration

    Swift

    @objc
    public internal(set) var lastPullTime: Date { get }
  • The number of messages exchanged in this conversation

    Declaration

    Swift

    @objc
    public internal(set) var length: Int { get }
  • The resource url of the conversation

    Declaration

    Swift

    @objc
    public internal(set) var resourceUrl: String { get }
  • url

    The url of the conversation

    Declaration

    Swift

    @objc
    public var url: String { get }
  • Public interface to fetch messages from the server. This interface is a simplified version for getting the most recent message.

    Declaration

    Swift

    @objc
    public func fetchMessages(completion: @escaping FetchBlock)

    Parameters

    completion

    Code block to execute once the fetch has completed.

  • Public interface to fetch messages from the server. This interface is a simplified version for getting the most recent message.

    Declaration

    Swift

    @objc
    public func fetchMessages(fetchOptions: FetchOptions, completion: @escaping FetchBlock)

    Parameters

    fetchCriteria

    Criterias to query.

    completion

    Code block to execute once the fetch has completed.

  • Public interface to delete a single message from the server. This is an abstract method meant to be implemented by classes that derive from Conversation.

    Declaration

    Swift

    @objc
    public func deleteMessage(withResourceUrl: String, completion: @escaping DeleteCompletionBlock)

    Parameters

    withId

    MessageID of message to delete.

    completion

    Code block to execute once the delete has completed.

  • Public interface to delete conversation.

    Declaration

    Swift

    @objc
    public func delete(completion: @escaping DeleteCompletionBlock)

    Parameters

    completion

    Code block to execute once the delete has completed.

  • Public method to send a text message.

    Declaration

    Swift

    @objc
    public func send(withText: String, _ completion: @escaping SendCompletionBlock)

    Parameters

    withText

    text for new message to add to this conversation.

    completion

    Code block to execute upon send completion.

  • Public method to send a message, using a template message.

    Declaration

    Swift

    @objc
    public func send(message: CPMessage, _ completion: @escaping SendCompletionBlock)

    Parameters

    message

    template message to add to this conversation. This can be a newly created message, or an existing inbound or outbound.

    completion

    Code block to execute upon send completion. This block returns the new outbound message created from the template.

  • Public method overrides default object printing.

    Declaration

    Swift

    override public var description: String { get }