ChatAdapter

public class ChatAdapter

This class represents the data-layer components of the Chat Composite.

  • The class to configure events closures for Chat Composite.

    See more

    Declaration

    Swift

    public class Events
  • The events handler for Chat Composite

    Declaration

    Swift

    public let events: Events
  • Create an instance of this class with options.

    Declaration

    Swift

    public init(endpoint: String,
                identifier: CommunicationIdentifier,
                credential: CommunicationTokenCredential,
                threadId: String,
                displayName: String? = nil)

    Parameters

    endpoint

    The endpoint URL of The Communication Services.

    identifier

    The CommunicationIdentifier that uniquely identifies an user

    credential

    The credential that authenticates the user to a chat thread

    threadId

    The unique identifier of a chat thread

    displayName

    The display name that would be used when sending a chat message If this is nil the display name defined when adding the user to chat thread from the service would be used

  • Start connection with chat client and registers for chat events This function should be called before adding the ChatComposite to a view

    Declaration

    Swift

    public func connect(completionHandler: ((Result<Void, ChatCompositeError>) -> Void)?)

    Parameters

    completionHandler

    The closure that will be called back when connection is established

  • connect() Asynchronous

    Start connection with chat client and registers for chat events This function should be called before adding the Chat Composite to a view

    Declaration

    Swift

    public func connect() async throws
  • Unsubscribe all the chat client events from Azure Communication Service

    Declaration

    Swift

    public func disconnect(completionHandler: @escaping ((Result<Void, ChatCompositeError>) -> Void))

    Parameters

    completionHandler

    The closure that will be called back when disconnection is complete

  • disconnect() Asynchronous

    Unsubscribe all the chat client events from Azure Communication Service

    Declaration

    Swift

    public func disconnect() async throws