social-networkingfacebook-opengraphsocial-mediawechathtml-head

WeChat thumbnail disappears when shared from the in-app browser


Issue:

When a user shares a webpage from a mobile browser's share menu to WeChat, a thumbnail image is rendered with that link as intended (the open graph image is populated). If the user opens that link, the WeChat's in-app browser is opened. Now, when user clicks to share that link from within the in-app browser, the thumbnail is no longer there (empty thumbnail link is displayed).

Question:

What is different about WeChat's in-app browser that makes it so the open graph image is not captured in the thumbnail like it is when shared via a normal browser (Chrome, Firefox, Safari).

Thank you in advance.


Solution

  • WeChat Provides a JSSDK, with the Share API in it you can specify the title, link, thumbnail, desc, etc of share behavior of current open page inside in-WeChat-browser.

    For Example, I have a Page, title: A, link: www.a.com:

    1. Without API, the share behavior is normal with title: A, link: www.a.com, thumbnail will be the first image in the webpage, and WeChat will grab some text for description.
    2. With the API setup (code blow), the share behavior can be totally different: title: b, link: www.b.com, image: b.jpg, etc.
    wx.onMenuShareTimeline({
      title: 'b',
      link: 'www.b.com',
      imgUrl: 'image/to/b.jpg'
    });