SCSChatSessionDelegate
@protocol SCSChatSessionDelegate <NSObject>
The SCSChatSessionDelegate
protocol provides state information about the chat
session. Add your implementation to -[SCSChat addDelegate:]
.
See
SCSChatSession
See
SCSChat
-
Tells the delegate an error was raised during a chat session.
See
Declaration
Objective-C
- (void)session:(id<SCSChatSession>)session didError:(NSError *)error fatal:(BOOL)fatal;
Swift
func session(_ session: SCSChatSession!, didError error: Error!, fatal: Bool)
Parameters
session
SCSChatSession
instance which invoked the error.error
NSError
instance describing the error. Error codes can be referenced fromSCSChatErrorCode
.fatal
Indicates whether the error resulted in the termination of a session.
-
Declaration
Objective-C
- (void)session:(id<SCSChatSession>)session didEnd:(SCSChatSessionEndEvent *)endEvent;
Swift
optional func session(_ session: SCSChatSession!, didEnd endEvent: SCSChatSessionEndEvent!)
Parameters
session
SCSChatSession
instance which invoked the method.endEvent
SCSChatSessionEndEvent
describing why the session has ended. Error codes can be referenced fromSCSChatErrorCode
. -
Tells the delegate when the chat session state has changed.
See
Declaration
Objective-C
- (void)session:(id<SCSChatSession>)session didTransitionFromState:(SCSChatSessionState)previous toState:(SCSChatSessionState)current;
Swift
optional func session(_ session: SCSChatSession!, didTransitionFrom previous: SCSChatSessionState, to current: SCSChatSessionState)
Parameters
session
SCSChatSession
instance which invoked the method.previous
SCSChatSessionState
previous state.current
SCSChatSessionState
current state. -
Tells the delegate when the user’s position in the agent queue has changed.
See
Declaration
Objective-C
- (void)session:(id<SCSChatSession>)session didUpdateQueuePosition:(NSNumber *)position estimatedWaitTime:(NSNumber *)waitTime;
Swift
optional func session(_ session: SCSChatSession!, didUpdateQueuePosition position: NSNumber!, estimatedWaitTime waitTime: NSNumber!)
Parameters
session
SCSChatSession
instance which invoked the method.position
NSNumber
instance representing position in the queue.waitTime
NSNumber
instance representing estimated wait time, in seconds. -
Tells the delegate when the user’s position in the agent queue has changed.
See
Declaration
Objective-C
- (void)session:(id<SCSChatSession>)session didUpdateQueuePosition:(NSNumber *)position;
Swift
optional func session(_ session: SCSChatSession!, didUpdateQueuePosition position: NSNumber!)
Parameters
session
SCSChatSession
instance which invoked the method.position
NSNumber
instance representing position in the queue.