How to customize the pictures generated by WeChat Mini Programs's forwarding and sharing function?

onShareAppMessage: function() {
    return {
      title: "xxxx",
      path: "xxxx",
      imageUrl: "",
      success: (res) => {
        console.log(res)
      },
      fail: (res) => {
        console.log(res)
      }
    }
  },

the effect image forwarded by this method is a screenshot of that page.
how to become a self-defined picture?

Feb.22,2022

what is the path of your page? local pictures and network resources are all available. There is no problem with using the absolute path to try


code. First make sure that the path of your picture is specified correctly. You can test
preview onShareAppMessage


the image placed on the server with an official example.


res is not written in parentheses

Menu