LikeStore

abstract class LikeStore

Like related interfaces, managing like sending, like state synchronization, and like event listening operations in live rooms/voice chat rooms.

Overview

LikeStore Like management class for handling like-related business logic in live rooms/voice chat rooms. LikeStore provides a complete set of like management APIs, including sending likes, listening to like events, and getting like states. Through this class, you can implement like interaction features in live rooms.

Core Features

  • Like Sending: Support sending likes to the current room

  • Like State: Get the accumulated like count of the current room

  • Event Listening: Listen to like receiving events

Important: Use the LikeStore.create factory method to create a LikeStore instance, which requires a valid live room ID. Like state updates are delivered through the likeState publisher. Subscribe to it to receive real-time updates of like data in the room.

Like Operations Overview

OperationMethodDescription
Send LikesendLikeSend likes to the current room
Get StatelikeStateGet the like state of the current room
Add ListeneraddLikeListenerAdd like event listener
Remove ListenerremoveLikeListenerRemove like event listener

Topics

Creating Instance

Observing State and Events

Like Operations

See Also

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
abstract val likeState: LikeState

Like state subscription for the current room, containing information such as accumulated like count. By subscribing to this state, you can get real-time updates of like data in the room.

Functions

Link copied to clipboard
abstract fun addLikeListener(listener: LikeListener?)

Add like event listener

Link copied to clipboard
abstract fun removeLikeListener(listener: LikeListener?)

Remove like event listener

Link copied to clipboard
abstract fun sendLike(count: Int = 1, completion: CompletionHandler?)

Send likes to the current room. All users who have subscribed to like events will receive this like notification.