Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unity facebook SDK, can not post picture with FB.Feed

In my Unity IOS game, I am unsuccessfully trying to use FB.Feed to share a screenshot on the user's wall. Facebook documentation uses FB.Api to publish the screenshot, but this method does not display a share dialog, it simply uploads the pic to Facebook.

Answers I have found so far:

  1. Upload the picture using FB.Api, and then parse the FBResult for the picture URL, and feed that to FB.Feed Link to answer. This method triggers an error, since it is not possible to use a Facebook URL as source for a picture.

  2. Save the picture locally and prepend "File://" to the picture path. Link to question. This does not seem to work either, and the Facebook documentation does not seem to have any information on URL formatting.

My question:

Is this the correct (and only) way to display a share dialog when publishing a picture? Or am I looking in the wrong direction?

like image 864
Mauro Palumbo Avatar asked May 28 '14 13:05

Mauro Palumbo


1 Answers

FB.Feed only allows you to post link to images. It doesn't upload the images to Facebook. Therefore, these images need to hosted somewhere on the net and not locally.

The best way to make it work is either upload the images to FB (with privacy property set to EVERYONE) using FB.API, and then share the link to that picture via FB.Feed. If you don't want to create duplicate stories, i.e. one from posting the picture and another from FB.Feed, make sure that you set no_story to true.

like image 111
Puneet Avatar answered Sep 30 '22 15:09

Puneet