MessageService

@objc
public class MessageService : NSObject

This is an abstract base class used to access the common functionality of a messaging service such as SmsService or ChatService.

  • User name from which a message is sent

    Declaration

    Swift

    @objc
    public var fromUser: String { get }
  • Undocumented

    Declaration

    Swift

    @objc
    public func getUserInfo() -> CPUserInfo

public interface to the messaging services

  • Sets sender identification information. By default the sender will be anonymous.

    Note

    By default the CPaaS service provider configured username will be used for both name and address.

    Declaration

    Swift

    @objc
    public func setSender(name: String)

    Parameters

    name

    Human readable user name to be sent with outbound request.

  • Public interface to fetch all conversation objects from the server.

    Declaration

    Swift

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

    Parameters

    completion

    Code block to execute once the fetch has completed.

  • Undocumented

    Declaration

    Swift

    @objc
    public func fetchConversations(withFetchCriteria: FetchCriteria, completion: @escaping FetchBlock)
  • Public interface to delete a conversation object from the server.

    Declaration

    Swift

    @objc
    public func delete(conversation: CPConversation, completion: @escaping DeleteCompletionBlock)

    Parameters

    conversation

    Conversation object representing the conversation to delete.

    completion

    Code block to execute once the delete has completed.

  • Public interface to create a new message within the conversation.

    Declaration

    Swift

    @objc
    public func createMessage(withText: String) -> CPOutboundMessage

    Parameters

    withText

    The text of the message.

    Return Value

    A CPOutboundMessage object ready to be sent.