Webber Lai
Webber Lai

Reputation: 2022

Post link on Facebook not show the link thumb image?

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

http://www.cronicadelquindio.com/noticia-completa-titulo-policia_homenajeo_a_ninos_enfermos_de_cancer__recibieron_el_grado_de_capitan_honorario-seccion-judiciales-nota-50748.htm

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

Answers (2)

Gyanendra Singh
Gyanendra Singh

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

C3roe
C3roe

Reputation: 96306

You’re putting your URL into the messageparameter, as plain text.

Try putting it into the link parameter instead.

Upvotes: 2

Related Questions