CoreClient

interface CoreClient

A CoreClient instance serves as the entry point to all Messaging for In-App actions and events.

Types

Link copied to clipboard
object Companion : Core

Properties

Link copied to clipboard

Gets the Configuration that this instance is configured with.

Link copied to clipboard
abstract val events: SharedFlow<CoreEvent>

A SharedFlow of CoreEvents

Link copied to clipboard
abstract val networkConnectivityState: StateFlow<NetworkConnectivityStatus>

Observes the current network connectivity status.

Link copied to clipboard
abstract val networkConnectivityStatusFlow: Flow<NetworkConnectivityStatus>

Observes the current network connectivity status.

Link copied to clipboard
abstract val realtimeConnectionState: Flow<ServerSentEvent.Connection>

Observes the current realtime connection state.

Functions

Link copied to clipboard
abstract fun conversationClient(conversationId: UUID = UUID.randomUUID()): ConversationClient

ConversationClient client for interacting with a conversation.

Link copied to clipboard
open fun conversations(limit: Int): Flow<Result<List<Conversation>>>
abstract fun conversations(limit: Int, sortedByActivityDescending: Boolean = true): Flow<Result<List<Conversation>>>
abstract suspend fun conversations(limit: Int, sortedByActivityDescending: Boolean = true, olderThanConversation: Conversation? = null): Result<List<Conversation>>

Retrieves n number of conversations from offline cached data sorted by latest activity. This only returns an order based on offline cached data, and may not reflect the real-time state of conversations if the client has not retrieved that activity.

abstract fun conversations(limit: Int, olderThanConversation: Conversation? = null): Flow<Result<List<Conversation>>>
abstract suspend fun conversations(limit: Int, olderThanConversation: Conversation? = null, conversationId: UUID? = null, forceRefresh: Boolean = false): Result<List<Conversation>>

Retrieves conversations available to the local participant.

Link copied to clipboard
abstract fun conversationsFlow(limit: Int, sortedByActivityDescending: Boolean = true, olderThanConversation: Conversation? = null): Flow<Result<List<Conversation>>>

Retrieves n number of conversations from offline cached data sorted by latest activity. This only returns an order based on offline cached data, and may not reflect the real-time state of conversations if the client has not retrieved that activity.

abstract fun conversationsFlow(limit: Int, olderThanConversation: Conversation? = null, conversationId: UUID? = null, forceRefresh: Boolean = false): Flow<Result<List<Conversation>>>

Retrieves conversations available to the local participant.

Link copied to clipboard
abstract fun conversationsPaged(pageSize: Int): Flow<Result<PagingData<Conversation>>>

Retrieves conversations available to the local participant.

abstract fun conversationsPaged(pageSize: Int, sortedByActivityDescending: Boolean = true): Flow<Result<PagingData<Conversation>>>

Retrieves n number of conversations from offline cached data sorted by latest activity. This only returns an order based on offline cached data, and may not reflect the real-time state of conversations if the client has not retrieved that activity.

Link copied to clipboard
abstract suspend fun deregisterDevice(): Result<Unit>

Deregister the device from receiving push notifications.

Link copied to clipboard
abstract fun destroy()

Destroys this instance.

Link copied to clipboard
abstract suspend fun markAsRead(conversationEntry: ConversationEntry): Result<ConversationEntry>

Sends a read acknowledgement for a ConversationEntry.

Link copied to clipboard

Registers a provider for supplying hidden pre-chat values.

Link copied to clipboard

Registers a provider for supplying templated URL values for an auto-response messaging component.

Link copied to clipboard

Registers a provider for authorizing an already authenticated user using one of the supported UserVerificationTypes.

Link copied to clipboard

Retrieves the BusinessHoursInfo object.

Link copied to clipboard

Retrieves the RemoteConfiguration object from Core.

Link copied to clipboard
abstract suspend fun retryEntry(conversationEntry: ConversationEntry): Result<ConversationEntry>

Re-sends a conversation entry.

Link copied to clipboard
abstract suspend fun revokeToken(deregisterDevice: Boolean): Result<Unit>

Revokes the authorization token preventing any further operations until a new token is granted. If your UserVerificationProvider returns a new token, the user is re-authorized. No action occurs in this method if Configuration.isUserVerificationRequired is set to false.

Link copied to clipboard
abstract fun start(scope: CoroutineScope)

Starts listening to remote events.

Link copied to clipboard
abstract fun stop()

Stops listening to remote events.