2014-05-06 117 views
0

我尝试通过对话框在FB上发布。在FBDialog中未显示缩略图图像在IOS中共享

但是我的照片没有显示为对话框中的缩略图。 当我发布时,图像显示在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

但依然没能解决。

帮我解决这个问题。

回答

0

请试试这个:

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

请添加Social.Framework框架。

+1

感谢您的回复!但我正在使用Native应用程序的对话框。 – user2893370