从分享直播卡片进入,getShareParams返回错误“只能从分享卡片进入”?

发布于 6 年前作者 utian13845 次浏览最后编辑 6 年前来自 ask
livePlayer.getShareParams({ scene: options.scene })
          .then(res => {
            console.log('get share openid', res.share_openid) // 分享者openid,分享卡片进入场景才有
            console.log('get openid', res.openid) // 用户openid
            console.log('get room id', res.room_id) // 房间号
            console.log('get custom params', res.customParams) // 开发者在跳转进入直播间页面时,页面路径上携带的自定义参数,这里传回给开发者
          }).catch(err => {
            console.log('get live params', err)
          })

 

按demo写的,然后scene也是1007,但是getShareParams报错,这是为啥?

是否因为是开发版或者体验版的原因呢?

1 回复
uliang
uliang1 楼4 年前

麻烦提供能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html