H5 after capturing the current screen using canvas, can you directly call Wechat api and share it to moments?

Product requirements: there is a custom sharing button on the h5 page. Click the custom sharing button to capture the current page, and then share it to moments

difficult: is this not available in jssdk? click the custom share button to directly access the api of moments? The compromise I think is to generate a screenshot, prompt the user to press the screenshot to save it locally, send it to the moments, and select the screenshot saved locally.



wx.ready(function () {      //
    wx.updateTimelineShareData({ 
        title: '', // 
        link: '', // JS
        imgUrl: '', // 
        success: function () {
          // 
        }
});

take a look at Wechat jssdk development documentation


landlord, have you solved your problem? I have encountered the same problem


official account has not been able to achieve the function you mentioned. Oh,


sharing must be triggered actively by the user, and can only guide the user to click on the upper right corner to share.
in addition, the shared image must be a link, and you have to find a way to upload the base64 data generated by the canvas image to the file server to generate a link.


I said I could do it.

  1. canvas screenshot is transferred to the server, and the server provides a picture link
  2. The
  3. front end receives this picture and updates the Wechat sharing settings on the current page
  4. A pop-up message prompts the user to share
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1be95cc-3195a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1be95cc-3195a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?