Session represent the connected environment of an UA. It's created after UA registration.
open private(set) var id: String!
open private(set) var connectionState: SessionConnectionState = .offline
Session connection state
open func getToken() -> String?
Returns this session's token if this is a cloud user's session, otherwise returns null
open func joinGroup(_ group: String)
Joins and subscribes to the group The user will be visible to both users inside the group and users who subscribed to it
open func leaveGroup(_ group: String)
Leaves and unsubscribes to a group Users within the group and users who subscribed to it will be notified
open func getContacts(group: String? = nil) -> [Contact]?
Returns contact for a given group
open func getOrCreateConversation(name: String) throws -> Conversation
Gets or creates a conversation for a given name Public conversation name format is alphanumeric Private conversation name format is alphanumeric:alphanumeric
open func getOrCreateConversation(url: 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)
open func getActiveConversations() -> [Conversation]?
Gets all currently joined conversations
open func joinConversationSpace(_ space: String)
open class func getActiveSession() -> Session?
Returns currently active session