1

我正在使用 facebook sdk 3.0

它很容易安装,但我发现了一些奇怪的东西

我无法显示链接的缩略图

检查我的代码,它很短

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];
           }];

就是这样~

但它只在墙上贴了一个链接,没有图像......

我尝试发布相同的 url 来更新状态,它可以显示拇指图像,

这是示例网址

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

当我使用 Facebook api 时我错过了什么???

任何回复或回答都会有所帮助

谢谢

韦伯

** * ** * ** * ** * ** * *编辑* ** * ** * ** * ** * ** * ****

它需要使用FBRequestConnection startWithGraphPath

所以,这是我的最终解决方案

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];

也请参考这个链接

4

2 回答 2

2

您将 URLmessage作为纯文本放入参数中。

尝试将其放入link参数中。

于 2012-08-15T12:50:33.667 回答
1

就我而言,我可以使用以下代码片段在 Facebook 上发布视频 URL 作为链接。

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];
于 2012-11-29T07:04:17.477 回答