怎么调用【微信小游戏的分享】

怎么调用【微信小游戏的分享】
https://developers.weixin.qq.com/minigame/dev/tutorial/open-ability/share.html?t=2018329
这个转发分享,完全没用啊,有人转发成功过微信小游戏的么?
里面的api怎么用呢?
写了这个函数,什么都没显示出来
wx.shareAppMessage({
title: ‘转发标题’
})

写这个也没弹出分享
wx.onShareAppMessage(function () {
return {
title: ‘转发标题’,
imageUrl: canvas.toTempFilePathSync({
destWidth: 500,
destHeight: 400
})
}
})

写什么才能弹出分享嗯?

wx.shareAppMessage({
title: ‘我要分享’,
success: function (res) {
console.log(‘拉起分享 成功’);
console.log(res);
},
fail: function (res) {
console.log(‘拉起分享 失败’);
console.log(res);
}
});

1赞

我在子域的onload写怎么会报错,显示not a futicon