收藏
回答

公众号H5自定义分享,安卓正常,IOS设备不生效?

const local = location.href
getJsSdkParams({
  url: local
}).then(res => {
  if (res.code !== 200) {
     return new Error('请求参数获取失败')
    }
wx.config({
  debug: false, 
  appId: res.data.appid, 
  timestamp: res.data.timestamp,
  nonceStr: res.data.nonceStr,
  signature: res.data.signature, 
  jsApiList: ['checkJsApi', 'updateAppMessageShareData', 'updateTimelineShareData', 'onMenuShareTimeline', 'onMenuShareAppMessage' ]
});
wx.checkJsApi({
  jsApiList: ['updateAppMessageShareData', 'updateTimelineShareData','onMenuShareTimeline', 'onMenuShareAppMessage'], 
  success: (res) => {}
  })
});

wx.ready(() => {
  const url = location.href
  const imgUrl = 'https://wdjiayuan.com/sqxy_files1649293994683.png'
  wx.updateAppMessageShareData({
    title: this.news.title,
    desc: this.news.desc, 
    link: url, 
    imgUrl, 
    success: (res) => {}
  });
  wx.updateTimelineShareData({
    title: this.news.title,
    desc: this.news.desc, 
    link: url, 
    imgUrl, 
    success: (res) => {}
  });
  wx.onMenuShareTimeline({
    title: this.news.title,
    desc: this.news.desc, 
    link: url, 
    imgUrl, 
    success: (res) => {}
  });
  wx.onMenuShareAppMessage({
    title: this.news.title,
    desc: this.news.desc, 
    link: url, 
    imgUrl, 
    success: (res) => {}
  });
});

以上是截取的部分代码,不知道哪里配置有问题还是咋回事,IOS就是不生效,寻求神、仙、魔、妖各路道友帮助,急急如律令,走你

回答关注问题邀请回答
收藏

1 个回答

登录 后发表内容