Search code examples
javascriptfacebooksdksharefeed

Sharing an image from javascript SDK does not load the image?


Here is the very simple code:

            var obj = {
                method: "feed",
                link: share_url,
                picture: share_url,
                name: "test name",
                caption: "test caption",
                description: "Using Dialogs to interact with users."
            };
            function callback(response) {
                console.log(response);
            }
            FB.ui(obj, callback);

The share_url is something like this:

http://www.majorforms.com/thumbnail.php?width=1200&height=1200&image=1033/4f/4f313dee7641ba3add3ac080f451277a9af9f0cc.jpg

The thing is that the post is written on my wall, but the image is not there! Even though I have given the same URL for "link" and "picture". Why is that?


Solution

  • Here is the answer. If I leave out the picture parameter, then everything works! E.g.

            var obj = {
                method: "feed",
                link: share_url,
                name: "test name",
                caption: "test caption",
                description: "Using Dialogs to interact with users."
            };
            function callback(response) {
                console.log(response);
            }
            FB.ui(obj, callback);
    

    I don't know why, but this is how it is.