【问题标题】:Post link on Facebook not show the link thumb image?在 Facebook 上发布链接不显示链接缩略图?
【发布时间】:2012-08-11 12:39:24
【问题描述】:

我正在使用 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-judiciales-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];

另外请参考link

【问题讨论】:

    标签: iphone ios facebook url thumbnails


    【解决方案1】:

    您将您的网址以纯文本形式放入message参数中。

    尝试将其放入 link 参数中。

    【讨论】:

    • 你能发布一些示例代码吗?真的不知道如何使用链接参数...
    【解决方案2】:

    就我而言,我可以使用以下代码 sn-p 在 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-03-03
      • 1970-01-01
      • 2012-02-02
      • 2013-10-03
      • 2012-05-10
      • 2012-02-07
      • 2011-09-24
      • 2016-06-20
      • 2011-10-20
      相关资源
      最近更新 更多