Baileys: [BUG] - Small Image for Link Preview, Expecting Large Image for Link Preview
Describe the bug I compare message containing link that i sent through baileys and whatsapp device (Web, mobile).
In baileys i sent it with getUrlInfo and i got small og:image in preview
But, in whatsapp device, i got large link preview, like image below
To Reproduce Steps to reproduce the behavior:
- Created a new connection
- send text message containing link and send it with
linkPreviewoption - You’ll receive message on destination jid
- Compare it with the link that you’ve sent with your own device
Expected behavior It should sent with large link preview
Additional context
here’s my makeWaSocket options
const sock = makeWASocket({
version,
logger,
printQRInTerminal: !usePairingCode,
mobile: false,
auth: {
creds: state.creds,
keys: makeCacheableSignalKeyStore(state.keys, logger),
},
msgRetryCounterCache,
generateHighQualityLinkPreview: true,
getMessage: async () => {
return proto.Message.fromObject({});
},
});
here’s my send message code
const urlFromText = extractUrlFromText(message);
let linkPreview;
if (urlFromText) {
try {
linkPreview = await getUrlInfo(urlFromText, {
thumbnailWidth: 1200,
fetchOpts: {
timeout: 5000,
},
});
} catch (error) {
console.error(error);
}
}
sock.sendPresenceUpdate("available", destination);
await sleep(500);
sock.sendPresenceUpdate("composing", destination);
await sleep(Math.max(message.length * 10, 7500));
sock.sendPresenceUpdate("paused", destination);
const result = await sock.sendMessage(destination, {
text: message,
linkPreview,
});
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 16
@mkhotib20, strangely, the generated preview link only shows on iOS devices. I can’t get it to display on Android devices. Have you faced the same issue?
here’s my code