Mini program live sharing card livePlayer.getShareParams

Mini Program Related Component Interface | WeChat Open Documentation

The project I am doing is a small program (react+taro).

Premise: The live broadcast plug-in has been introduced before the project. Requirements: To share the live broadcast room (that is, a card), you need to invite people to enter the live broadcast room and get openId, rommId, etc.

1. Introduce the live broadcast component (I have already introduced the main package in the project, so I proceed to the second step)

 2. To introduce the following figure into the app.js operation, the summary is: I put the let reference at the top, and I replaced the onshow with componentDidShow (taro's life cycle). According to the needs of the project, I only used 1007 and 1008 for the scene value. (The summary of my lessons is 1) The share card can only be entered into the res of livePlayer.getShareParams to get the value after the inviter clicks on the live broadcast room. The wrong way of writing is to share the non-live page and invite the inviter to enter the page (click the button on this page——enter Live broadcast room), so it does not meet the prompt err: only the parameters of the sharing card entry can be obtained ② Pay attention to whether the page is in the main package or sub-package to match the plugin introduced by app.js)

  

Guess you like

Origin blog.csdn.net/weixin_62226731/article/details/129688851