Builder

class Builder(apiKey: String, appContext: Context) : ChatClient.ChatClientBuilder

Builder to initialize the singleton ChatClient instance and configure its parameters.

Parameters

apiKey

The API key of your Stream Chat app obtained from the Stream Dashboard.

appContext

The application Context.

Constructors

Link copied to clipboard
constructor(apiKey: String, appContext: Context)

Functions

Link copied to clipboard

Sets the base URL to be used by the client.

Link copied to clipboard
open override fun build(): ChatClient

Create a ChatClient instance based on the current configuration of the Builder.

Link copied to clipboard

Sets a ChatClientDebugger instance that will be invoked accordingly through various flows within SDK.

Link copied to clipboard

Overrides a default, based on shared preferences implementation for UserCredentialStorage.

Link copied to clipboard

Debug requests using ApiRequestsAnalyser. Use this to debug your requests. This shouldn't be enabled in release builds as it uses a memory cache.

Link copied to clipboard

Allows simultaneous network calls of the same request, avoiding combining them into one. By default distinctApiCalls is enabled.

Link copied to clipboard

By default, ChatClient performs a dummy HTTP call to the Stream API when a user is set to initialize the HTTP connection and make subsequent requests reusing this connection execute faster.

Link copied to clipboard

Sets a custom FileTransformer implementation that will be used by the client to transform files before uploading them.

Link copied to clipboard

Sets a custom file uploader implementation that will be used by the client to upload files and images.

Link copied to clipboard

Force to use insecure connection (HTTP) instead of secure connection (HTTPS). This is useful for testing purposes. By default, the client uses HTTPS. Production apps should always use HTTPS.

Link copied to clipboard
open override fun internalBuild(): ChatClient
Link copied to clipboard

Sets a ChatLoggerHandler instance that will receive log events from the SDK.

Link copied to clipboard

Sets the log level to be used by the client.

Link copied to clipboard
fun notifications(notificationConfig: NotificationConfig, notificationsHandler: NotificationHandler = NotificationHandlerFactory.createNotificationHandler( context = appContext, notificationConfig = notificationConfig, )): ChatClient.Builder

Sets a custom NotificationHandler that the SDK will use to handle everything around push notifications. Create your own subclass and override methods to customize notification appearance and behavior.

Link copied to clipboard
fun okHttpClient(okHttpClient: OkHttpClient): ChatClient.Builder

Sets a custom OkHttpClient that will be used by the client to perform API calls to Stream.

Link copied to clipboard
fun retryPolicy(retryPolicy: RetryPolicy): ChatClient.Builder

Sets a custom RetryPolicy used to determine whether a particular call should be retried. By default, no calls are retried.

Link copied to clipboard

An enumeration of various network types used as a constraint inside upload attachments worker.

Link copied to clipboard
fun withPlugins(vararg pluginFactories: PluginFactory): ChatClient.Builder

Adds plugins factory to be used by the client.

Link copied to clipboard

Inject a RepositoryFactory.Provider to use your own DB Persistence mechanism.