I have a Facebook canvas app, written in AS3, and using the Adobe Facebook API.
I can connect, get a list of friends, pick a friend, all that stuff is working fine. The problem is when I try and post to a friend’s wall. I am trying to post an image. That’s it, just an image.
The image is 200×200, which meets the facebook guidlines of not being smaller than 50×50 and outside of a 3:1 ratio.
I have searched all over the interwebz for an answer and have tried all examples I can find. I have cobbled together what looked like promising attempts, only to have the image still not show up. Other info, like the message, link etc, do show up if I include it. Just no picture. Here is the code that looked the most promising based on what facebook docs say.
Facebook.api('/' + friendID +'/feed', onPicPosted, {image:imageToPost, message:messageToPost, fileName:'FILE_NAME'}, URLRequestMethod.POST);
friendID is the selected friend, imageToPost is a bitmap, onPicPosted is the callback, which returns successful, even though the image does not show up.
I have also tried a slight variation based on someone’s suggestion, changing image to picture in the params object.
Facebook.api('/' + friendID +'/feed', onPicPosted, {picture:imageToPost, message:messageToPost, fileName:'FILE_NAME'}, URLRequestMethod.POST);
permissions have been properly requested and granted (‘publish_stream’, and also ‘user_photos’ and ‘friends_photos’ just for safe measure).
This issue is delaying a delivery so it is urgent I figure this out. If anyone has an idea of how to accomplish posting an image (bitmap, created in flash) to a selected friend’s wall, please help! Thanks!
After some more research:
This is not possible. image is not a property expected, rather picture is, and picture expects a url as its value not a bitmap.
The solution was to first upload the image to a server via php, then post the image with the returned url.
Also, as a side note, an image posted to a friend’s wall via an app can be no larger than 90×90. It can be larger than that if posted to the user’s own wall, but not to the user’s friends’ walls.