Gift Store
Gift-related interface, managing gift sending, gift state synchronization, and gift event listening in live rooms/voice chat rooms.
Overview
GiftStore Gift management class for handling gift-related business logic in live rooms/voice chat rooms. GiftStore provides a complete set of gift management APIs, including sending gifts, refreshing gift lists, setting language, and listening to gift events. Through this class, gift interaction features can be implemented in live rooms.
Core Features
Gift Sending: Support sending specified gifts to the current room
Gift List: Get and refresh the available gift list in the current room
Language Setting: Set the display language for gift information
Event Listening: Listen to gift receiving events
Important: Use the GiftStore.create factory method to create a
GiftStoreinstance, passing a valid live room ID. Gift state updates are delivered through the giftState publisher. Subscribe to it to receive real-time updates of gift data in the room.
Gift Operations Overview
| Feature | Method | Description |
| Create Instance | GiftStore.create | Create a gift management instance for the specified room |
| Send Gift | sendGift | Send a specified gift to the current room |
| Refresh List | refreshUsableGifts | Manually refresh the available gift list in the current room |
| Language Setting | setLanguage | Set the display language for gift information |
| Event Listening | addGiftListener/removeGiftListener | Add/remove gift event listeners |
Topics
Creating Instance
GiftStore.create - Create gift management instance
Observing State and Events
giftState - Reactive state containing available gift list
addGiftListener/removeGiftListener - Gift event callbacks
Gift Operations
sendGift - Send gift
refreshUsableGifts - Refresh available gift list
setLanguage - Set display language
See Also
Properties
Functions
Gift event publisher. Through this publisher, you can subscribe to/remove gift events in live rooms/voice chat rooms. After subscribing, you will receive corresponding notifications when viewers send gifts.
Manually refresh the available gift list in the current room.
Send a specified gift to the current room
Set the display language for gift information.