I'm trying to post Photo, URL, message and name to Facebook from my iOS application to user's wall. I'm using latest Facebook framework 3.1
I'm using following code:
NSDictionary* dict = @{
@"link" : @"https://www.yahoo.com",
@"picture" : UIImagePNGRepresentation([UIImage imageNamed:@"Default.png"]),
@"message":@"Your message here",
@"name" : prodName,
@"caption" : [NSString stringWithFormat:@"Try the app: %@", prodName],
@"description" : @"Integrating Facebook in ios"
};
[FBRequestConnection startWithGraphPath:@"me/photos" parameters:dict HTTPMethod:@"POST" completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
NSString *alertText;
if (error)
{
NSLog(@"%@",[NSString stringWithFormat: @"error: domain = %@, code = %d", error.domain, error.code]);
alertText = @"Failed to post to Facebook, try again";
} else
{
alertText = @"Posted successfully to Facebook";
}
[[[UIAlertView alloc] initWithTitle:@"Facebook Result" message:alertText delegate:nil cancelButtonTitle:@"OK!" otherButtonTitles:nil] show];
}];
I'm able to post successfully. But I'm seeing in Facebook that, its posting only photo and message and not other details. If I'm using @"me/feed", I'm not even able to post successfully. Facebook is giving error code=5.
How can I post all the details?