Polyv Help Center

Help Center

6-互动

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

1.Interaction

The core external class of the Interaction Manager is PLVInteractManager, which can be accessed via the interactManager property of the SDK object.

2.Interaction Page

The Interaction Page is a Web component whose core external class is PLVInteractWeb. Simply embed this component into the layout to complete the integration of the Interaction Page.

PLVInteractWeb({
  interactManager: this.interactManager, // 互动管理器
  interactCallback: this.interactCallback, // 互动回调
  controller: this.controller, // web组件控制器
  redpackManager: this.redpackManager // 红包管理器
})

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

3.Callbacks

Interaction business event messages are registered and monitored via interactCallback, including:

  • processWebViewVisibility: Callback registration for web component visibility changes
  • processOpenLinkEvent: Callback registration for opening links within the interaction
  • processClickProductEvent: Callback registration for clicking on products

Taking monitoring web component visibility messages as an example, it can be done as follows:

interactCallback.processWebViewVisibility = (show) => {
  // 处理逻辑
  this.viewController.isShow = show
}

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

联系客服,在线咨询