Posting photo to Facebook using facebook.showdialog

Hi Coronites,

I’m trying to share a photo to Facebook using facebook.showDialog, but I can’t get this working and I can’t find an example either.  Here’s my code:

[lua]facebook.showDialog( “feed”, {
redirect_uri = “www.website.com”,
link = “www.website.com”,
picture = { baseDir=system.ResourceDirectory, filename=“photo.png”, type=“image” },
name = “name”,
caption = “Caption”,
description = “Description”
})
[/lua]

Here’s the Facebook documentation (https://developers.facebook.com/docs/reference/dialogs/feed/):

“The URL of a picture attached to this post. The picture must be at least 200px by 200px. See our documentation onmaximizing distribution for media content for more information on sizes.”

I’ve managed to successfully use the facebook.showDialog to post text to Facebook, but not yet with a photo as well.  Hope you can help.

Have you looked at the facebook sample app in the SampleCode/Networking folder? 

Rob

Hi Rob,

Yes - I’ve had a look, and the only feed dialog example I can find doesn’t post a picture:

facebook.showDialog( “feed”, {

                name = “Test name”,

                description = “Example description.”,

                link = “http://www.coronasdk.com/

            })

Best,

Ed

It’s very possible that this form does not support uploading photos.  If you look at the facebook docs for showDialog:

https://developers.facebook.com/docs/reference/dialogs/feed/

It states: “picture: The URL of a picture attached to this post. The picture must be at least 200px by 200px. See our documentation on maximizing distribution for media content for more information on sizes.

There are no other references to uploading photos.  Since this says URL, I’m assuming the photo needs to be on the Internet somewhere and its not something you upload from  your device.

Rob

You could use the social plugin for this task

Have you looked at the facebook sample app in the SampleCode/Networking folder? 

Rob

Hi Rob,

Yes - I’ve had a look, and the only feed dialog example I can find doesn’t post a picture:

facebook.showDialog( “feed”, {

                name = “Test name”,

                description = “Example description.”,

                link = “http://www.coronasdk.com/

            })

Best,

Ed

It’s very possible that this form does not support uploading photos.  If you look at the facebook docs for showDialog:

https://developers.facebook.com/docs/reference/dialogs/feed/

It states: “picture: The URL of a picture attached to this post. The picture must be at least 200px by 200px. See our documentation on maximizing distribution for media content for more information on sizes.

There are no other references to uploading photos.  Since this says URL, I’m assuming the photo needs to be on the Internet somewhere and its not something you upload from  your device.

Rob

You could use the social plugin for this task