Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Messenger not displaying images in Generic template in mobile App

I'm sending Facebook a structured message with a URL to an image file (the file is in Amazon S3). The message is structured according to https://developers.facebook.com/docs/messenger-platform/send-api-reference/generic-template (Generic template).

The message is being received and shown just fine - but the image doesn't appear in the mobile iOS Messenger app (I didn't test Android). It DOES appear in the web version of Messenger.

Anyone know what can cause this?

Thanks in advance!

like image 895
Yariv Adam Avatar asked Jul 28 '16 14:07

Yariv Adam


People also ask

Why is Messenger not showing pictures?

Check Facebook Messenger Server Status If the servers are down, you need to wait for Facebook to fix the issue from their end. Once the servers are up and running, Facebook Messenger should load media without issues.

How do I fix Messenger not displaying messages?

Quit and Reopen the App At most times, the app's internal issues such as bugs or glitches may restrict Facebook Messenger from displaying the message. Hereby, here you need to restart the Facebook Messenger app as many times as a simple restart fixes most of the glitches that stop the app from running properly.

How do I create a message template in Messenger?

Create your message templateIn the Ad Creative section, Under Call to Action, choose Send Message. In the Message Template section, choose Create New. You can also Generate Leads to collect information from customers in a Messenger conversation. Click + Create.


2 Answers

This happens in iOS Messenger app when there is no subdomain in the URL of the image.

In my case, I change from https://example.com/image.jpg to https://mysub.example.com/image.jpg and the problem is solved.

like image 73
ArtCHNK Avatar answered Dec 31 '22 00:12

ArtCHNK


This happens because Facebook caches images by their URL. Let's say you're trying to send an image at URL http://example.org/image.png in your generic template.

When you make a call to the Send API, FB attempts to loads the image from http://example.org/image.png. When you send the same image in the future FB uses their cached version instead of reloading it from your endpoint. If this endpoint fails to serve the image correctly at the first send, FB will continue to cache / render a blank image.

I encountered this and fixed it by doing the following:

  1. Make sure my image could be accessed at http://example.org/image.png

  2. Add a URL parameter for the image_url in your call to FB API. Use http://example.org/image.png?time=1524606955198

Hopefully your image starts showing up.

like image 44
Abhishek Chadha Avatar answered Dec 30 '22 23:12

Abhishek Chadha