Failed to add image with url parameters in Facebook feed dialog (direct url)

I was wondering how I can add parameters to my URl image in this example:

https://www.facebook.com/dialog/feed?app_id=...&link=...&picture=www.blablabladotcom?parameter1=1ยถmeter2=2&name=...&caption=...&description=...&redirect_uri = ...

I tried with encoding% 26 and no image is displayed. The weird thing is that when I try to use% 26 on the redirect_uri parameter, it works fine. Any advice on this?

+3


source to share


1 answer


You need to code all parts correctly (Java Script example below):

var _FBAPPID = "xxxxxxxxxx", // your app ID (mandatory)
    _name = "name",
    _text = "text",
    _link = "link",
    _picture = "http://cdn2.insidermonkey.com/blog/wp-content/uploads/2012/10/facebook4-e1349213205149.jpg", // some google image - replace it
    _caption = "caption",
    _redirect_uri = "http://google.com" // this URL must be from within the domain you specified in your app settings

var _params = "&name=" + encodeURIComponent(_name)
    + "&description=" + encodeURIComponent(_text)
    + "&link=" + encodeURIComponent(_link)
    + "&picture=" + encodeURIComponent(_picture)
    + "&caption=" + encodeURIComponent(_caption)
    + "&redirect_uri=" + encodeURIComponent(_redirect_uri);

var _href = "http://www.facebook.com/dialog/feed?app_id=" + _FBAPPID + _params + "&display=touch";

      



I also added display=touch

because I am using a direct url for mobile only.

Source here .

0


source







All Articles