Polyv Help Center

Help Center

8-打赏

Updated: 2024-10-18 17:34:17

1. Tipping

The core external class of the tipping manager is PLVRewardManager, which can be accessed via the rewardManager property of the SDK object.

2. Callbacks

The tipping configuration is requested when the SDK initializes the live page data. Here, we register to listen for it, including:

  • rewardManager.eventNotify.on: Tipping configuration callback

For example, to listen for the tipping configuration, you can do so as follows:

sdk.rewardManager.eventNotify.on('reward_setting', (value: PLVRewardSettingVO) => {
  // 处理逻辑
}, this)

For detailed usage code, refer to the PLVLILiveHomeLayout class in the demo project.

3. Gift Tipping

Currently, the SDK only supports gift tipping (including cash payment (free only) and points payment types), corresponding to the makeGiftCashReward and makePointReward methods respectively:

rewardManager.makeGiftCashReward(goodId, goodNum)
rewardManager.makePointReward(goodId, goodNum)

For detailed usage code, refer to the PLVLIRewardView class in the demo project.

联系客服,在线咨询