I'm trying to upload a local, user created photo from my application to the user's Facebook Wall. I'm developing an app in Objective-C and using the PhFacebook library to interact with the social network, but I think it's more likely my problem is coming from my flawed use of the actual interaction with Facebook.

Indeed, to upload a status to the user's profile, after having gotten an access token, this code works perfectly well:

I've tried modifying the source key to image, photo, picture, file, and data, but no changes could be seen, and source seems to be the most correct.

After having read the documentation about uploading photos: http://developers.facebook.com/docs/reference/api/photo/, I've understood that the source parameter corresponds to a URL. I've tried directly uploading the image's data or the image's local path on the user's computer, but I still haven't found a way to upload an image that isn't already on Internet. I'm sure there's a way to do this, even the word upload implies that the image should be local !

I just tried the method on the post here: Facebook connect on iOS picture doesn't display with wall post and it might help your cause.
However, it seems that the behaviour is slightly different from a real "wall picture post", since the pictures are uploaded to your application photo album instead of the "wall album".

When you post several pictures within a few moments using a Facebook app, Facebook mentions that "[YourFBName] has added several pictures to the [ApplicationName] album" (a "grouped" wall post for different events).

Whereas when you post several pictures on the wall using the FB interface directly, even though they are all added to the "Wall album", they are always shown as separate posts (wall posts are not grouped here).

Thanks for the help. That code is interesting, but I've narrowed down my problem to the library I'm using to interact with Facebook. Indeed, PhFacebook only lets you upload an image as a URL, not as an NSData... I have to use this library, because it's the only Mac API for Facebook that handles the login process well, and I have no idea how to port Facebook iOS's login dialog. Do you have an idea?
–
elliottbolzanDec 2 '11 at 2:06

And there you go ! This solution almost seems simpler than using existing frameworks ! The only time-consuming part is building the WebView interface, but you can simply inspire yourself from the link I posted and PhFacebook.h, which uses a similar (yet slightly different) technique.