Patrick
Patrick

Reputation: 252

Facebook:How can I always post a photo to the wall

I can get the photo to appear in the user's feed, but only the first photo. Uploading successive photos after that still adds the photo to the album named as my app, but it doesn't seem to do anything else to the feed.

NSURL *requestUrl = [NSURL URLWithString:[NSString stringWithFormat:@"https://graph.facebook.com/me/photos?access_token=%@",self.fbAccessToken]]; 
self.fbRequest = [ASIFormDataRequest requestWithURL:requestUrl];
[self.fbRequest  setTimeOutSeconds:60];
self.fbRequest .uploadProgressDelegate = self;
self.fbRequest .delegate = self;
self.fbRequest .requestMethod = @"POST";
[self.fbRequest  setPostValue:[item customValueForKey:@"status"]  forKey:@"message"];
[self.fbRequest  addData:UIImagePNGRepresentation(item.image) forKey:@"source"];
self.fbRequest.tag = RequestStepUpload;
[self.fbRequest  startAsynchronous];

Upvotes: 0

Views: 732

Answers (1)

parag
parag

Reputation: 657

hi you have to post a image on facebook then please refer this tutorial. we are working with this code and it is working very well in iphone and ipad.

http://www.icodeblog.com/2011/03/28/facebook-sdk-posting-to-user-news-feed/

Thanks.

Upvotes: 1

Related Questions