ChatState
@objc(ZDKChatState)
public final class ChatState : NSObject, ReflectedStringConvertible, InitialStateProtocol
ZDKChatState
is a model representation of the current chat session.
Can gather information about the agents
in the session, the visitor’s queuePosition
,
what status
the chat is in, and the list of logs
in the session
-
Empty chat state
Declaration
Swift
@objc public static let initial: ChatState
-
The chat comment
Declaration
Swift
@objc public let comment: String
-
The chat rating
Declaration
Swift
public let rating: Rating
-
[Agent]
assigned to the channelDeclaration
Swift
@objc public let agents: [Agent]
-
Whether the chat session is active. If
false
then the chat has ended.Declaration
Swift
@objc public let isChatting: Bool
-
Chat session id
Declaration
Swift
@objc public let chatId: String?
-
Selected department
Declaration
Swift
@objc public let department: Department?
-
Array of ChatLogs that have occured in the chat. eg. Member join/leave, attachments
Declaration
Swift
@objc public let logs: [ChatLog]
-
Queue position
Declaration
Swift
@objc public var queuePosition: QueuePosition
-
The status of the current chat session.
Declaration
Swift
@objc public internal(set) var chatSessionStatus: ChatSessionStatus { get }
-
Returns log with given message id
Declaration
Swift
@objc public func log(withId id: String) -> ChatLog?
Parameters
id
message id
-
Returns a Boolean value that indicates whether the receiver and a given object are equal.
Declaration
Swift
@objc override public func isEqual(_ object: Any?) -> Bool
Parameters
object
the object to compare against