- Preparation:
- 1. Developer permission + mini game category
- 2. Place the shared picture Resources folder: resources/texture/share.png
wx.showShareMenu({withShareTicket:true})
cc.loader.loadRes("texture/share",function(err,data){ wx.onShareAppMessage(function(res){ return {title: "The classic airplane game is always as fun as ever, come on! Let’s relive the fun of the classic together.", imageUrl: data. url, success(res){ console.log(res) }, fail(res){ console.log(res) }} })});
//3. Actively pull up the sharing interface cc.loader.loadRes("texture/share",function (err,data){ wx.shareAppMessage({ title: "The classic airplane game is always fun, come on! Let's relive the fun of classics together. ", imageUrl: data.url, success(res){ console.log(res ) }, fail(res){ console.log(res)} })}) pre>