Baileys icon indicating copy to clipboard operation
Baileys copied to clipboard

[BUG] Link preview images not showing on Android devices

Open fogolin opened this issue 1 year ago • 5 comments

Whenever using Baileys to send a link to another user, it renders a different behavior for each platform:

  • On the web and iOS, it render ok, normal
  • On Android, it doesn't render the image, only the remaining information:

image

I actually went and tried solving it running different tests as shown in this issue by mkhotib20, but with no different results: https://github.com/WhiskeySockets/Baileys/issues/260

The content of the message doesn't really matter, if it's only the link or in the middle of the text. Using getUrlInfo always results in bringing all the information needed to render the linkPreview:

{
  'canonical-url': 'https://github.com/',
  'matched-text': '*Name of user:*\nhttps://github.com/',
  title: 'GitHub: Let’s build from here',
  description: 'GitHub is where over 100 million developers shape the future of software, together. Contribute to the open source community, manage your Git repositories, review code like a pro, track bugs and features, power your CI/CD and DevOps workflows, and secure code before you commit it.',
  originalThumbnailUrl: 'https://github.githubassets.com/images/modules/site/social-cards/campaign-social.png',
  jpegThumbnail: <Buffer >,
  highQualityThumbnail: ImageMessage {
    interactiveAnnotations: [],
    scanLengths: [],
    url: 'https://mmg.whatsapp.net/o1/v/t62.7118-24/f1/m233/up-oil-image-<CENSORED>?ccb=9-4&oh=01_<CENSORED>=650EE5F2&mms3=true',
    mimetype: 'image/jpeg',
    fileSha256: <Buffer ab ec 31 5b 8e 8b b6 ea 46 0d b9 d1 a3 2d db a5 f0 ac 57 ca a9 e7 bb 3f f0 d1 e8 3f 5f 71 ea 54>,
    fileLength: Long { low: 309453, high: 0, unsigned: true },
    mediaKey: <Buffer 98 6e 22 b3 84 10 16 17 a7 6f 3b 41 f3 41 f8 bd ba 13 a4 55 b4 62 f8 43 0a 9e 07 2d da 91 ac 99>,
    fileEncSha256: <Buffer d7 33 f9 d9 bf 48 aa 41 a5 88 40 90 b9 39 9c 18 db e9 db 5e d9 6e 6c e1 1d ed c1 a3 31 67 b8 26>,
    directPath: '/o1/v/t62.7118-24/f1/m233/up-oil-image-<CENSORED>?ccb=9-4&oh=01_<CENSORED>&oe=650EE5F2',
    mediaKeyTimestamp: Long { low: 1692895570, high: 0, unsigned: false }
  }
}

If I try and send the same link with the exact same message through Web or even the Android platform, it renders correctly. I got some other to test it and they confirmed as well, it's not rendering correctly on Android.

fogolin avatar Aug 24 '23 18:08 fogolin

still an issue?

purpshell avatar May 25 '24 15:05 purpshell

still an issue?

Yes, it is. Apparently spread to the web channel as well: the same message is now rendering only text preview both on Android and WhatsApp Web.

fogolin avatar May 25 '24 18:05 fogolin

It works on WhatsApp web, but not on Android, any solution?

Lucaselsande avatar Jul 02 '24 15:07 Lucaselsande