InAppMessaging

Interface for in-app messaging functionality.

Interface for in-app messaging functionality.

Syntax: interface InAppMessaging : ConnectModule

Properties

PropertiesDescription
connectionStatusRepresents the current connection status.
val connectionStatus: ConnectionStatus
isConnectedIndicates whether there is an active connection.
val isConnected: Boolean
mediaFileManagerThe media file manager for handling media files.
val mediaFileManager: MediaFileManager
messageStoreThe store for in-app messages.
var messageStore: MessageStore?
messageSynchronizationPolicyThe policy for message synchronization.
var messageSynchronizationPolicy: MessageSynchronizationPolicy?

Functions

connect()

Initiates a connection.

Syntax: fun connect()

Throws: WebexConnectException If the connection fails.

disconnect()

Disconnects the current session.

Syntax: fun disconnect()

Throws: WebexConnectException: If the disconnection fails.

registerConnectionStatusListener(listener)

Registers a listener for connection status changed events.

Syntax: fun registerConnectionStatusListener(listener: ConnectionStatusListener)

Parameters

ParameterTypeDescription
listenerConnectionStatusListenerThe listener to register.

unregisterConnectionStatusListener(listener)

Unregister a previously registered listener.

Syntax: fun unregisterConnectionStatusListener(listener: ConnectionStatusListener)

Parameters

ParametersTypeDescription
listenerConnectionStatusListenerThe listener to unregister.

registerMessagingListener(listener)

Registers a listener for in-app messaging events.

Syntax:fun registerMessagingListener(listener: InAppMessagingListener)

ParameterTypeDescription
listenerInAppMessagingListenerThe listener to register.

unregisterMessagingListener(listener)

Unregister a previously registered listener.

Syntax: fun unregisterMessagingListener(listener: InAppMessagingListener)

Parameters

ParameterTypeDescription
listenerInAppMessagingListenerThe listener to unregister.

publishMessage(message, callback)

Publishes a new in-app message.

Syntax: fun publishMessage(message: InAppMessage,callback: PublishMessageCallback)

Parameters

ParametersTypeDescription
messageInAppMessageThe message is to be published.
callbackPublishMessageCallbackThe callback is to be invoked as a result of the publish operation.

closeThread(thread, callback)

Closes a thread.

Syntax: fun closeThread(thread: InAppThread, callback: UpdateThreadCallback)

Parameters

ParametersTypeDescription
threadInAppThreadThe thread is to be closed.
callbackUpdateThreadCallbackThe callback is to be invoked as a result of the close operation.

deleteMessage(messageTransactionId, callback)

Deletes a previously sent in-app message.

Syntax: fun deleteMessage(messageTransactionId: String,callback: DeleteMessageCallback)

Parameters

ParameterTypeDescription
messageTransactionIdStringThe transaction ID of the message is to be deleted.
callbackDeleteMessageCallbackThe callback is to be invoked as a result of the delete operation.

fetchMessages(threadId, beforeDate, limit, callback)

Fetches a list of messages from a specific thread.

Syntax:fun fetchMessages(threadId: String, beforeDate: Date?, limit: Int, callback: FetchMessagesCallback)

Parameters

ParametersTypeDescription
threadIdStringThe ID of the thread from which to fetch messages.
beforeDateDateThe date before which messages should be fetched.
limitIntThe maximum number of messages to fetch.
callbackFetchMessagesCallbackThe callback is to be invoked with the fetched messages.

publishTypingIndicator(thread, isTyping)

Publishes a typing indicator message to the given thread.

Syntax: fun publishTypingIndicator(thread: InAppThread, isTyping: Boolean)

Parameters

ParametersTypeDescription
threadInAppThreadThe thread is to publish the typing indicator message.
isTypingBooleanThe flag indicates whether the typing indicator is active or not.

createPostbackMessage(message, button)

Creates a postback message for a button click.

Syntax: fun createPostbackMessage(message: InAppMessage, button: InAppButton): InAppMessage

Return A new instance of [InAppMessage] representing the postback message.

Parameters

ParametersTypeDescription
messageInAppMessageThe message to create a postback message.
buttonInAppButtonThe button that was clicked.

createThread(thread, callback)

Creates a new thread.

Syntax:fun createThread(thread: InAppThread,callback: CreateThreadCallback)

Parameters

ParametersTypeDescription
threadInAppThreadThe thread to be created.
callbackCreateThreadCallbackThe callback is to be invoked as a result of the create operation.

updateThread(thread, callback)

Updates an existing thread.

Syntax: fun updateThread(thread: InAppThread, callback: UpdateThreadCallback)

ParameterTypeDescription
threadInAppThreadThe thread is to be updated.
callbackUpdateThreadCallbackThe callback is to be invoked as a result of the update operation.

fetchThreads(beforeDate, limit, callback, category, type)

Fetches a list of threads with optional filtering by category or type.

Syntax: fun fetchThreads(beforeDate: Date, limit: Int, callback: FetchThreadsCallback, category: String? = null, type: InAppThreadType? = null)

Parameters

ParametersTypeDescription
beforeDatedateThe date before which threads should be fetched.
limitIntThe maximum number of threads to fetch.
callbackFetchThreadsCallbackThe callback is to be invoked with the fetched threads.
categorystringOptional category to filter the threads by.
typeInAppThreadTypeOptional type to filter the threads by.

fetchThread

Fetches the details of a specific thread.

Syntax: fun fetchThread(threadId: String, callback: FetchThreadCallback)

ParametersTypeDescription
threadIdStringThe ID of the thread to fetch.
callbackFetchThreadCallbackThe callback is to be invoked with the thread details.

fetchUnreadThreadCount(callback)

Fetches the count of unread threads.

Syntax: fun fetchUnreadThreadCount( callback: FetchUnreadThreadCountCallback )

Parameters

ParametersTypeDescription
callbackFetchUnreadThreadCountCallbackThe callback is to be invoked with the count of unread threads.

sendMessageStatus( messageTransactionIds, status, callback )

Updates the status of one or more messages.

Syntax: abstract fun sendMessageStatus(vararg messageTransactionIds: String, status: InAppMessageStatus, callback: SendMessageStatusCallback? )

ParametersTypeDescription
messageTransactionIdsArrayVararg of message transaction IDs whose status is to be updated.
statusInAppMessageStatusThe new status is to be applied to the messages.
callbackSendMessageStatusCallbackOptional callback invoked as a result of the status update operation.

sendMessageStatus(messageTransactionId, status, button, callback)

Updates the status of a message.

Syntax: fun sendMessageStatus(messageTransactionId: String, status: InAppMessageStatus, button: InAppButton? = null, callback: SendMessageStatusCallback? )

Parameters

ParametersTypeDescription
messageTransactionIdStringThe message transaction ID whose status is to be updated.
statusInAppMessageStatusThe new status is to be applied to the message.
buttonInAppButtonThe button that was clicked.
callbackSendMessageStatusCallbackOptional callback invoked with the result of the status update operation.

shutdown

Syntax: fun shutdown()

startup

Syntax: fun startup()