ChatSession

class ChatSession(configurationOnce: Once<SdkConfiguration>, val currentProfileOnce: Once<LiveLikeProfile>, val isPublicRoom: Boolean = true, val chatEnforceUniqueMessageCallback: Boolean = false, val analyticsService: AnalyticsService, var errorDelegate: ErrorDelegate? = null, liveLikeChatClient: LiveLikeChatClient, val liveLikeProfileClient: LiveLikeProfileClient, val networkApiClient: NetworkApiClient, includeFilteredChatMessages: Boolean, val dataStoreDelegate: DataStoreDelegate, val quoteChatMessageDeletedMessage: String, val chatMessageDeletedMessage: String, isPlatformLocalContentImageUrl: (String) -> Boolean, getInputStreamForImageUrl: (String) -> InputStream?, getSizeOfImage: (ByteArray) -> ImageSize, val preLoadImage: suspend (String) -> Boolean, sessionDispatcher: CoroutineDispatcher, uiDispatcher: CoroutineDispatcher, synchronizationDispatcher: CoroutineDispatcher, getReactionSession: (String) -> LiveLikeReactionSession, currentPlayheadTime: () -> EpochTime) : BaseSession, LiveLikeChatSession

Constructors

Link copied to clipboard
constructor(configurationOnce: Once<SdkConfiguration>, currentProfileOnce: Once<LiveLikeProfile>, isPublicRoom: Boolean = true, chatEnforceUniqueMessageCallback: Boolean = false, analyticsService: AnalyticsService, errorDelegate: ErrorDelegate? = null, liveLikeChatClient: LiveLikeChatClient, liveLikeProfileClient: LiveLikeProfileClient, networkApiClient: NetworkApiClient, includeFilteredChatMessages: Boolean, dataStoreDelegate: DataStoreDelegate, quoteChatMessageDeletedMessage: String, chatMessageDeletedMessage: String, isPlatformLocalContentImageUrl: (String) -> Boolean, getInputStreamForImageUrl: (String) -> InputStream?, getSizeOfImage: (ByteArray) -> ImageSize, preLoadImage: suspend (String) -> Boolean, sessionDispatcher: CoroutineDispatcher, uiDispatcher: CoroutineDispatcher, synchronizationDispatcher: CoroutineDispatcher, getReactionSession: (String) -> LiveLikeReactionSession, currentPlayheadTime: () -> EpochTime)

Properties

Link copied to clipboard
Link copied to clipboard
open override var avatarUrl: String?

Avatar Image Url

Link copied to clipboard
val chatLoadedFlow: StateFlow<String?>
Link copied to clipboard
val chatSessionIdleFlow: SharedFlow<Boolean>
Link copied to clipboard
val currentChatRoomFlow: StateFlow<ChatRoom?>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val flushMessagesFlow: MutableStateFlow<String?>
Link copied to clipboard
open override var getCurrentChatRoom: () -> String

The current chat room

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val preLoadImage: suspend (String) -> Boolean
Link copied to clipboard
protected val sessionErrorHandlerScope: CoroutineScope
Link copied to clipboard
val sessionScope: CoroutineScope
Link copied to clipboard
protected val uiScope: CoroutineScope
Link copied to clipboard
val updateUrlFlow: StateFlow<Pair<ChatRoom, Boolean>?>

Functions

Link copied to clipboard
open override fun clearMessages()

to clear chat messages

Link copied to clipboard
open override fun close()

Closes the current session.

Link copied to clipboard
open override fun connectToChatRoom(chatRoomId: String)

open override fun connectToChatRoom(chatRoomId: String, callback: LiveLikeCallback<Unit>? = null, callbackWithSeverity: LiveLikeCallbackWithSeverity<Unit>? = null)

To connect to the chatRoom with provided chatRoomId, by default it will load initial messages

Link copied to clipboard
open override fun deleteMessage(messageId: String, liveLikeCallback: LiveLikeCallback<LiveLikeEmptyResponse>)

Deletes a chat message with the specified message ID.

Link copied to clipboard
fun destroy()
Link copied to clipboard
open override fun getChatMessageReplies(getChatMessageRepliesRequestOption: GetChatMessageRepliesRequestOption? = null, callback: LiveLikeCallback<List<LiveLikeChatMessage>>? = null)

to get chat messages

Link copied to clipboard
open override fun getDeletedMessages(): ArrayList<String>

to get the deleted messages from the loaded message

Link copied to clipboard

To get the loaded message

Link copied to clipboard
open override fun getMessageCount(startTimestamp: Long, callback: LiveLikeCallback<Byte>)

Returns the number of messages published on a chatroom since a given time

Link copied to clipboard
open override fun getPlayheadTime(): EpochTime

Return the playheadTime for this session.

Link copied to clipboard
open override fun getReactions(liveLikeCallback: LiveLikeCallback<List<Reaction>>)

to get all the available reactions for use in chat

Link copied to clipboard
open override fun getStickerPacks(liveLikeCallback: LiveLikeCallback<List<StickerPack>>)

to get all the available sticker packs

Link copied to clipboard
open override fun isReceivingRealtimeUpdates(): Boolean

Checks whether the system is currently receiving real-time updates.

Link copied to clipboard
open override fun loadNextHistory(limit: Int = 20, sinceMessageId: String? = null, callbackWithSeverity: LiveLikeCallbackWithSeverity<List<LiveLikeChatMessage>>? = null)

to load Chat History

Link copied to clipboard
open override fun onBlockProfile(blockedInfo: BlockedInfo)
Link copied to clipboard
open override fun onUnBlockProfile(blockInfoId: String, blockProfileId: String)
Link copied to clipboard
open override fun pause()

Pause the current Chat and widget sessions. This generally happens when ads are presented

Link copied to clipboard
open override fun quoteMessage(message: String?, parentMessageId: String? = null, imageUrl: String? = null, imageWidth: Int?, imageHeight: Int?, quoteMessageId: String, quoteMessage: LiveLikeChatMessage, messageMetadata: Map<String, Any?>? = null, attributes: List<LiveLikeChatAttributes>? = null, liveLikePreCallback: LiveLikeCallback<LiveLikeChatMessage>, chatInterceptor: ChatInterceptor? = null, callback: LiveLikeCallback<LiveLikeChatMessage>? = null)

Quotes a chat message with the provided details and sends it to the chat.

Link copied to clipboard
open override fun removeMessageReactions(messageId: String, reactionId: String, liveLikeCallback: LiveLikeCallback<LiveLikeEmptyResponse>)

removes a reaction from a particular message.

Link copied to clipboard
open override fun reportMessage(message: LiveLikeChatMessage, liveLikeCallback: LiveLikeCallback<LiveLikeEmptyResponse>)
open override fun reportMessage(messageId: String, liveLikeCallback: LiveLikeCallback<LiveLikeEmptyResponse>)

Reports a message

Link copied to clipboard
open override fun resume()

Resume the current Chat and widget sessions. This generally happens when ads are completed

Link copied to clipboard
protected fun <T : Any> safeCallBack(call: suspend (Pair<LiveLikeProfile, SdkConfiguration>) -> T?)
protected fun <T : Any> safeCallBack(liveLikeCallBack: LiveLikeCallback<T>?, liveLikeCallbackWithSeverity: LiveLikeCallbackWithSeverity<T>?, call: suspend (Pair<LiveLikeProfile, SdkConfiguration>) -> T?)
Link copied to clipboard
open override fun sendCustomChatMessage(customData: String, liveLikeCallback: LiveLikeCallback<LiveLikeChatMessage>)

send Custom Chat Message

Link copied to clipboard
open override fun sendMessage(message: String?, parentMessageId: String? = null, imageUrl: String? = null, imageWidth: Int? = null, imageHeight: Int? = null, messageMetadata: Map<String, Any?>? = null, attributes: List<LiveLikeChatAttributes>? = null, liveLikePreCallback: LiveLikeCallback<LiveLikeChatMessage>, chatInterceptor: ChatInterceptor? = null, callback: LiveLikeCallback<LiveLikeChatMessage>? = null)

TODO: added it into default chat once all functionality related to chat is done

Link copied to clipboard
open override fun sendMessageReaction(messageId: String, reactionId: String, liveLikeCallback: LiveLikeCallback<LiveLikeEmptyResponse>)

adds a reaction to a particular message.This supports multiple reaction also per user

Link copied to clipboard
open override fun setChatRoomListener(chatRoomListener: ChatRoomListener?)

Register a chatRoom listener for the specified Chat Room

Link copied to clipboard
open override fun setMessageListener(messageListener: MessageListener?)

Register a message count listner for the specified Chat Room

Link copied to clipboard
open override fun setMessageWithReactionListener(messageWithReactionListener: MessageWithReactionListener?)