【问题标题】:Thumbnail Image is not shown in FBDialog Sharing in IOSIOS的FBDialog共享中不显示缩略图图像
【发布时间】:2014-05-06 13:42:15
【问题描述】:

我尝试通过对话框在 FB 上发帖。

但我的图片在对话框中没有显示为缩略图。 当我发布时,图像显示在 Web 上,但未显示在对话框中。

我的代码如下:

    FBShareDialogParams *params = [[FBShareDialogParams alloc] init];
        params.link = [NSURL URLWithString:[Dict objectForKey:@"url"]];
        params.name = [Dict objectForKey:@"name"];
        params.caption = [Dict objectForKey:@"dicription"];
        params.picture=[NSURL URLWithString:@"https://s3-us-west-2.amazonaws.com/appicon/facebook-share-logo.png"];
        params.description = [Dict objectForKey:@"dicription"];

if ([FBDialogs canPresentShareDialogWithParams:params])
        {
            /*
            [FBDialogs presentShareDialogWithLink:params.link
                                             name:params.name
                                          caption:params.caption
                                      description:params.description
                                          picture:params.picture
                                      clientState:nil
                                          handler:^(FBAppCall *call, NSDictionary *results, NSError *error)
             {
                 if(error)
                 {
                     // An error occurred, we need to handle the error
                     // See: https://developers.facebook.com/docs/ios/errors
                     //NSLog(@"%@",[NSString stringWithFormat:@"Error publishing story: %@", error.description]);
                 }
                 else
                 {
                     // Success
                     //NSLog(@"result %@", results);
                 }
             }];
}

我也参考了这个链接:Same Issue

但还是没能解决。

帮我解决这个问题。

【问题讨论】:

    标签: ios objective-c facebook facebook-graph-api


    【解决方案1】:

    请试试这个:

    SLComposeViewController *Facebooksheet = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];
    [Facebooksheet addImage:[UIImage imageNamed:@"image.png"]];
    [self presentViewController:Facebooksheet animated:YES completion:nil];
    

    请添加 Social.Framework 框架。

    【讨论】:

    • 感谢您的回复!但我正在使用本机应用程序的对话框。
    猜你喜欢
    • 1970-01-01
    • 2015-06-04
    • 2014-08-27
    • 2014-04-11
    • 1970-01-01
    • 2014-08-29
    • 1970-01-01
    • 2012-08-26
    • 1970-01-01
    相关资源
    最近更新 更多