onShareAppMessage不走成功回调

发布于 6 年前作者 fangpeng7983 次浏览最后编辑 6 年前来自 ask
  • 当前 Bug 的表现(可附上截图)

安卓 小米8 机器 onShareAppMessage 分享按钮分享成功后不走成功回调方法

  • 预期表现

进入成功回调

  • 复现路径

  • 提供一个最简复现 Demo

2 回复
hma
hma1 楼6 年前

分享成功后不走成功回调是正常的,走回调才是不正常的,现在已经改成无法监听用户分享成功或者失败了

tangchao
tangchao2 楼4 年前
<button  open-type='share'>分享按钮</button>
onShareAppMessage (res) {
 
    if (res.from === 'button') {
 
      // 进来了
 
      return {
 
        title: this.shareDesc,
 
        path: path,
 
        imageUrl: this.activityImg,
 
        success: (res) => {
 
          // 小米 8 有时能走进来 有时候不能
 
          }
 
        }
 
      }
 
    }
 
  }