Session

open class Session : Observable<SessionEvent>
extension Session: Equatable

Session represent the connected context of UserAgent.

  • id

    Undocumented

    Declaration

    Swift

    open private(set) var id: String! { get }
  • Declaration

    Swift

    open func joinConversationSpace(_ space: String)
  • Declaration

    Swift

    open func getContact(id: String) -> Contact?

    Return Value

    Contact using contact id

  • Declaration

    Swift

    open func getContacts(group: String? = nil) -> [Contact]?

    Return Value

    Array of [Contact] for a given group

  • Declaration

    Swift

    open func getToken() -> String?

    Return Value

    This session’s token if this is a cloud user’s session

  • Gets or creates a conversation for a given name Public conversation name format is alphanumeric Private conversation name format is alphanumeric:alphanumeric

    Declaration

    Swift

    open func getOrCreateConversation(name: String) throws -> Conversation?
  • Gets or creates a conversation for a given url, convenient if the application handles links. Url should have correct format: Public conversation: http(s)://example.com/conversationId(alphanumeric) Private conversation: http(s)://example.com/private/enterpriseId(alphanumeric)/conversationId(alphanumeric)

    Declaration

    Swift

    open func getOrCreateConversation(url: String) throws -> Conversation?
  • Sends data message to the contactId Note: Use Conversation.pushData to send large amount of data in conversation context

    Declaration

    Swift

    open func sendRawData(contactId: String, data: [String : Any?])
  • Undocumented

    Declaration

    Swift

    open override func onEvent(_ observer: AnyObject, _ callback: @escaping ((SessionEvent) -> Void))
  • Declaration

    Swift

    public static func == (lhs: Session, rhs: Session) -> Bool