收藏
回答

使用wx.miniapp.shareMiniProgramMessage多端应用失效,如何解决?

错误信息:wx.miniapp.shareMiniProgramMessage parameter error: parameter.webpageUrl should be String instead of Undefined;parameter.userName should be String instead of Undefined;parameter.imagePath should be String instead of Undefined;parameter.withShareTicket should be Boolean instead of Undefined;parameter.miniprogramType should be Number instead of Undefined;parameter.scene should be Number instead of Undefined;

以下是我的代码,找不到问题在哪里,上述错误提示好像我没有出现错误,但为何会提示:

wx.miniapp.shareMiniProgramMessage({
        userName'gh_77af01acc***',
        path'/pages/index/index',
        title'邀请参加聚会',
        imagePath'/pages/thumb.png',
        webpageUrl'https://www.qq.com',
        withShareTicket: true,
        miniprogramType1,
        scene0,
        success(res) {
          wx.showToast({
            title'成功:分享小程序',
          })
          console.log(res)
        },
        fail() {
          wx.showToast({
            title'失败:分享小程序',
          })
        }
      })


最后一次编辑于  2025-05-16
回答关注问题邀请回答
收藏

2 个回答

  • 开发者平台小助手
    开发者平台小助手
    2025-05-21

    你把vconsole打开,试一下将内容在console里打印出来,然后再逐一对比一下

    2025-05-21
    有用
    回复
  • 徐珏
    徐珏
    2025-05-22

    试了上面没有写错

    2025-05-22
    有用
    回复
登录 后发表内容