FB share dialog with dynamic image and URL using SDK JS v2.8

1.1k views Asked by At

I have this code:

FB.ui({
    method: 'feed',
    display: 'popup',
    //redirect_uri: url,
    name: title,
    description: description,
    caption: 'test',
    link: url,
    picture: image
}, function (response) {
    console.log(response);
});

This share the image to FB timeline but without any description and any text provided in options. Also when I click on image on FB timeline it links to image URL and not the URL I set in link or redirect_uri option.

When I uncomment the redirect_uri option then the image is not set in dialog - so in this case it is without the image.

How can I share to FB timeline using custom image url and link url where the user should be redirected when click on this image?

I cannot set image to og:image tag because the image is generated and saved using PHP and then the URL of the image is returned and after it I trigger FB.ui method.

I'm using FB app in version 2.8

Thanks

0

There are 0 answers