Wednesday, January 05, 2011

Uploading photo to facebook via Facebook iOS SDK

The facebook iOS SDK is quite simply. Just downloading from https://github.com/facebook/facebook-ios-sdk and take a look in it DemoApp.
One problem their, the "photo upload" function does not automatically publish the uploaded photo, it wait for user to approve them.

The solution is very easy, following the facebook REST document: http://developers.facebook.com/docs/reference/rest/photos.upload
You must include "publish_stream" into _permission array at line 47 of DemoAppViewController.m

I hope this help!

2 Comments:

At 8:56 AM , Blogger Unknown said...

thanks Hugo, its works perfect.

 
At 8:32 AM , Anonymous Anonymous said...

Thanks, you saved me a lot of search work! I just could not understand why the upload did not work in their very own demo!

A note that might help others: I just downloaded the demo project today (the Hackbook project) and it seems to have a different structure nowadays: The permissions array is now constructed in RootViewController.m, line 156.
I applied your solution there and photo and video upload worked like a charm.

Thanks again!

 

Post a Comment

Subscribe to Post Comments [Atom]

<< Home