Builder

class Builder

Builder for creating and configuring a ChatController instance.

Use the builder to register listeners and start the chat session. Call chatEventListener to register the host's event listener, then build with a configured AccountInfo to obtain the ChatController.

Usage:

val controller = ChatController.Builder(context)
.chatEventListener(this)
.build(messengerAccount, chatLoadedListener)

Parameters

context

An Android Context. Use the host activity's context so the chat UI can attach to the activity lifecycle.

Constructors

Link copied to clipboard
constructor(context: Context)

Creates a new builder bound to the given context.

Functions

Link copied to clipboard
fun build(account: AccountInfo, loadListener: ChatLoadedListener? = null): ChatController

Builds the ChatController and starts loading the chat session for the given account.

Link copied to clipboard

Registers the ChatEventListener that receives state changes, errors, and chat elements for this controller.