Reputation: 2022
I'm using the facebook sdk 3.0
It is easy to install , but I found something strange
I can't show the link's thumbnail
check my code , it's short
NSString *message = [NSString stringWithFormat:@"%@ is reading this news : \n %@",
self.loggedInUser.first_name,[[dataList objectAtIndex:index] objectForKey:@"NewsURL"]];
[FBRequestConnection startForPostStatusUpdate:message completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
// [self showAlert:message result:result error:error];
}];
that's it ~
But It only post a link on the wall , no images ...
I try to post the same url to update status , it can show the thumb images ,
here is the sample URL
What do I miss when I using the Facebook api ???
Any reply or answer will be help
Thanks
Webber
****************EDIT********************
It need to use FBRequestConnection startWithGraphPath
So , These is my final solution
NSMutableDictionary *postParams = [[NSMutableDictionary alloc] initWithObjectsAndKeys:newsURL, @"link",
newsTitle,@"name",nil];
[FBRequestConnection startWithGraphPath:@"me/feed"
parameters:postParams
HTTPMethod:@"POST"
completionHandler:^(FBRequestConnection *connection,id result,NSError *error) {
}];
[postParams release];
And also please reference this link
Upvotes: 1
Views: 1992
Reputation: 1483
In my case I was able to publish a Video URL as link on Facebook using the below code snippet.
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
g_videoURL, @"link",
VideoDescriptionHeading, @"message",
VideoThumbURL, @"picture",
VideoTitle, @"name",
VideoDescription, @"description",
nil];
[[appDelegate facebook] requestWithGraphPath:@"me/feed"
andParams:params
andHttpMethod:@"POST"
andDelegate:self];
Upvotes: 1
Reputation: 96306
You’re putting your URL into the message
parameter, as plain text.
Try putting it into the link
parameter instead.
Upvotes: 2