Take the 2-minute tour ×

I want to post a link including an image to Facebook timeline:

UIImage *img = [UIImage imageNamed:@"1.png"];
    self.postParams =
    [[NSMutableDictionary alloc] initWithObjectsAndKeys:
     @"Here we go", @"message",
     UIImagePNGRepresentation(img), @"picture",

    [FBRequestConnection startWithGraphPath:@"me/feed" parameters:self.postParams HTTPMethod:@"POST"
                              [self showAlert:@"Link is posted" result:result error:error];

The UIImage does not posted. Can you help me?

But simply if I use :

@"https://developers.facebook.com/attachment/iossdk_logo.png", @"picture"

it works.

share|improve this question
add comment

2 Answers

up vote 3 down vote accepted

If you read the documentation, it says the "picture" parameter should be of type string ie: a url. You can not post an image and a message from the mobile SDKs at the same time without some clever hackory: see me/photos in the documentation but your options are severely limited.

share|improve this answer
You are completely right. what about if I make a URL from my UIImage and then use that string in my params? –  Ali Oct 26 '12 at 12:27
yes, if you follow the instructions in the doc it will usually work –  Paul de Lange Oct 26 '12 at 12:45
add comment
 NSMutableDictionary *params = 
    [NSMutableDictionary dictionaryWithObjectsAndKeys:
     @"Example Name Is here", @"name",
     @"Caption Is Here", @"caption",
     @"Description is Here", @"description",
     @"http://yourLink.com/link.jsp", @"link",
     @"http://www.myImage.com/image.png", @"picture",
    [facebook dialog:@"feed"

It works fine for me but here i used UIImage with NSURL you can try this One.

share|improve this answer
add comment

Your Answer


