ConnectionProvider

@objc(ZDKConnectionProvider)
public final class ConnectionProvider : NSObject

ZDKConnectionProvider gives the ability to observe connection updates.

  • The current status of the Connection

    Declaration

    Swift

    @objc
    public var status: ConnectionStatus { get }
  • Connect to the session

    Declaration

    Swift

    @objc
    public func connect()
  • Disconnect from the current session, closes the socket connection. Please note, this won’t end the chat session with agent

    Declaration

    Swift

    @objc
    public func disconnect()
  • Observe connection status updates. Specify a closure how the status should be handled

    Declaration

    Swift

    @objc
    public func observeConnectionStatus(_ completion: @escaping (ConnectionStatus) -> Void) -> ObservationToken

    Parameters

    completion

    Specify how to handle the ConnectionStatus via closure.

    Return Value

    An ObservationToken that can cancel the subscription to the ConnectionStatus.

  • Declaration

    Swift

    public func setReachability(reachability: ReachabilityProtocol)