Facebook sharer.php ignores image

265 picture 265 · Mar 1, 2013 · Viewed 13.7k times · Source

have a trouble with sharing site material via facebook's sharer.php

Open window with standart code:

url = "http://www.facebook.com/sharer.php?s=100&p[title]=" + encodeURIComponent(title) + "&p[summary]=" + encodeURIComponent(description) + "&p[url]=" + encodeURIComponent(url) + "&p[images][0]=" + encodeURIComponent(image) + "&nocache=" + randomString(8);
window.open(url, '', 'toolbar=0,status=0,width=626,height=436');

where p[images][0] has correct image url.

Full URL example: CLICKCLAC

As you can see in Firebug there is right image in DOM tree, but it has "hidden_elem" class hang. Any ideas how to make it work, friends?

Or how to launch my js in iframe window :D

Answer

JBar picture JBar · Mar 1, 2013

This might help: https://developers.facebook.com/docs/reference/dialogs/feed/

I got your link and image to show with this: https://www.facebook.com/dialog/feed?app_id=458358780877780&link=https://www.agenda.travel&picture=http://agenda.travel/i/welcome-slide-1.png&name=Wonderful%20Title&caption=Wonderful%20Caption&description=Wonderful%20description&redirect_uri=https://mighty-lowlands-6381.herokuapp.com/

You need an app id for this to work, and i hear sharer.php is deprecated and this is the way to go now.

App will give you two parameters for this: APP_ID and REDIRECT_URI will be validated against it.