Cocos calls a small program sharing interface

  • Preparation:
    • 1. Developer permission + mini game category
    • 2. Place the shared picture Resources folder: resources/texture/share.png
//1. Show the forward button of the current pagewx.showShareMenu({withShareTicket:true})
//2. Monitor: share interfacecc.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>

Leave a Comment

Your email address will not be published.