ContentSession

class ContentSession(val configurationOnce: Once<SdkConfiguration>, val currentProfileOnce: Once<LiveLikeProfile>, rewardTypeFlow: MutableStateFlow<String?>, programId: String, val analyticService: AnalyticsService, errorDelegate: ErrorDelegate? = null, connectToDefaultChatRoom: Boolean, val networkApiClient: NetworkApiClient, val dataStoreDelegate: DataStoreDelegate, val chatSession: LiveLikeChatSession, val isLayoutTransitionEnabled: Boolean, preLoadImage: suspend (String) -> Boolean, lottieAnimationPath: (String) -> String??, leaderboardClient: LiveLikeLeaderBoardClient, leaderBoardDelegateHandler: (LeaderBoardDelegate) -> Unit, sessionDispatcher: CoroutineDispatcher, uiDispatcher: CoroutineDispatcher, currentPlayheadTime: () -> EpochTime) : BaseSession, LiveLikeContentSession

Constructors

Link copied to clipboard
constructor(configurationOnce: Once<SdkConfiguration>, currentProfileOnce: Once<LiveLikeProfile>, rewardTypeFlow: MutableStateFlow<String?>, programId: String, analyticService: AnalyticsService, errorDelegate: ErrorDelegate? = null, connectToDefaultChatRoom: Boolean, networkApiClient: NetworkApiClient, dataStoreDelegate: DataStoreDelegate, chatSession: LiveLikeChatSession, isLayoutTransitionEnabled: Boolean, preLoadImage: suspend (String) -> Boolean, lottieAnimationPath: (String) -> String??, leaderboardClient: LiveLikeLeaderBoardClient, leaderBoardDelegateHandler: (LeaderBoardDelegate) -> Unit, sessionDispatcher: CoroutineDispatcher, uiDispatcher: CoroutineDispatcher, currentPlayheadTime: () -> EpochTime)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val chatSession: LiveLikeChatSession

The analytics services

Link copied to clipboard
Link copied to clipboard
val currentWidgetViewFlow: MutableStateFlow<Pair<String, WidgetInfos>?>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
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
open override val widgetFlow: Flow<LiveLikeWidget>
Link copied to clipboard

Intercepts the widgets and hold them until show() or dismiss() is being called

Link copied to clipboard
open override val widgetStream: Stream<LiveLikeWidget>

Functions

Link copied to clipboard
open override fun close()

Closes the current session.

Link copied to clipboard
open override fun contentSessionId(): String

Return the content Session Id (Program Id) for this session.

Link copied to clipboard
fun destroy()
Link copied to clipboard
open override fun getLeaderboardClients(leaderBoardId: List<String>, liveLikeCallback: LiveLikeCallback<LeaderboardClient>)

Returns list of leaderboards associated to entered program

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

Return the playheadTime for this session.

Link copied to clipboard
open override fun getPublishedWidgets(getPublishedWidgetsRequestOptions: GetPublishedWidgetsRequestOptions, liveLikeCallback: LiveLikeCallback<List<LiveLikeWidget>>)

Return the widget list which has been published if the result is empty that means there is no data further and user reached end of list

Link copied to clipboard
open override fun getRewardItems(): List<RewardItem>

Returns list of reward item associated to entered program

Link copied to clipboard
open override fun getWidgetInteraction(widgetId: String, widgetKind: String, widgetInteractionUrl: String, liveLikeCallback: LiveLikeCallback<WidgetUserInteractionBase>)

Returns interactions for widget

Link copied to clipboard
open override fun getWidgetInteractions(widgetKinds: List<String>, liveLikeCallback: LiveLikeCallback<Map<String, List<WidgetUserInteractionBase>>>)

Returns interactions for widget

Returns list of interactions for which rewards have not been claimed

Link copied to clipboard
open override fun getWidgetModelFromJson(widgetResourceJson: JsonObject): BaseViewModel?

Returns the BaseViewModel object to utilize the apis with there own custom Widget

Link copied to clipboard
Link copied to clipboard
open override fun getWidgets(liveLikePagination: LiveLikePagination, requestParams: WidgetsRequestParameters?, liveLikeCallback: LiveLikeCallback<List<LiveLikeWidget>>)

Returns widget models based on the options parameter provided

Link copied to clipboard
open override fun isReceivingRealtimeUpdates(): Boolean
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 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 subscribeToChannels(channels: List<String>): Flow<RealTimeClientMessage>?

Returns Flow and subscribe to specified pubnub channels

Link copied to clipboard
open override fun unsubscribeFromChannels(channels: List<String>)

Unsubscribe from specified pubnub channels