Posting a screen shot to facebook

Hi All,

I need to take a screenshot and then post this screen shot to facebook. I am successfully able to take screen shot and I am also successfully posting simple text messages to Facebook. Now I want to take a screenshot from within the App and then post this screenshot to facebook. I need some help onthis. I am trying to do it this way

local function postPhoto\_onRelease( event ) local screenCap = display.captureScreen( false ) fbCommand = POST\_PHOTO facebook.login( appId, listener, {"publish\_stream"} ) end

And then in the listener I am doing this way

if fbCommand == POST\_PHOTO then local attachment = { name = "Some name", link = "http://www.somelink.com", caption = "Link caption", description = "Some caption", picture = screenCap, actions = json.encode( { { name = "Learn More", link = "http://coronalabs.com" } } ) } facebook.request( "me/feed", "POST", attachment ) end

Please guide me where I am wrong as I am not able to post the screenshot although post is made on facebook but screenshot is missing.

Thanks in advance

Been a while since i did that but try targeting your photo(s) folder like below…

facebook.request( " me/photos", "POST", {message ="Check out this photo!", source = { baseDir= system.DocumentsDirectory, filename="photo.jpg", type="image" } })  

…and not your feed as if i remember correctly the photo you upload won’t show in your feed directly, it will load into your photos folder and then, in your feed, it should indicate that you have uploaded a photo. 

Been a while since i did that but try targeting your photo(s) folder like below…

facebook.request( " me/photos", "POST", {message ="Check out this photo!", source = { baseDir= system.DocumentsDirectory, filename="photo.jpg", type="image" } })  

…and not your feed as if i remember correctly the photo you upload won’t show in your feed directly, it will load into your photos folder and then, in your feed, it should indicate that you have uploaded a photo.