Ios Facebook SDK如何共享图像、链接和文本?

Ios Facebook SDK如何共享图像、链接和文本?,ios,iphone,facebook,facebook-graph-api,Ios,Iphone,Facebook,Facebook Graph Api,我正在ios应用程序中使用最后一个facebook sdk,我正在尝试共享带有描述和链接的图像。我试过了 [FBDialogs presentShareDialogWithLink] 但是我在共享结果中看不到我的描述文本。我试过了 [FBDialogs presentShareDialogWithPhotoParams] 但是FBPhotoParams的描述字段是“onlyread”,我不能添加任何文本。因此,我放弃了各种fbdialogs,尝试了在我的另一个应用程序中使用的功能: if

我正在ios应用程序中使用最后一个facebook sdk,我正在尝试共享带有描述和链接的图像。我试过了

[FBDialogs presentShareDialogWithLink] 
但是我在共享结果中看不到我的描述文本。我试过了

[FBDialogs presentShareDialogWithPhotoParams] 
但是FBPhotoParams的描述字段是“onlyread”,我不能添加任何文本。因此,我放弃了各种fbdialogs,尝试了在我的另一个应用程序中使用的功能:

if ([[FBSession activeSession] isOpen]) {
    /*
     * if the current session has no publish permission we need to reauthorize
     */
    if ([[[FBSession activeSession] permissions]indexOfObject:@"publish_actions"] == NSNotFound) {

        [[FBSession activeSession] requestNewPublishPermissions:[NSArray arrayWithObject:@"publish_actions"] defaultAudience:FBSessionDefaultAudienceFriends
                                              completionHandler:^(FBSession *session,NSError *error){
                                                  [self share];
                                              }];

    }else{
        [self share];
    }
}else{
    /*
     * open a new session with publish permission
     */

    [FBSession openActiveSessionWithPublishPermissions:[NSArray arrayWithObject:@"publish_actions"]
                                       defaultAudience:FBSessionDefaultAudienceOnlyMe
                                          allowLoginUI:YES
                                     completionHandler:^(FBSession *session, FBSessionState status, NSError *error) {
                                         if (!error && status == FBSessionStateOpen) {
                                             [self share];
                                         }else{
                                             NSLog(@"error");
                                         }
                                     }];



}
现在此方法不起作用,并返回一个错误:

"OAuth \"Facebook Platform\" \"insufficient_scope\" \"(#200) The user hasn't authorized the application to perform this action\"";
我没有共享权限,但用户从未看到权限对话框…也许我必须向Facebook提交我的应用程序,以获得我的Facebook应用程序的“一般”发布权限?这只是一个链接,我不想发送构建,等待批准,ecc。。现在与图片和文本共享链接真的很复杂吗?我认为会有一个更简单的解决办法。。。我该怎么办?

用这个

NSMutableDictionary *parameter = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                   name, @"name",
                                   author, @"caption",
                                   linkShare, @"link",
                                   userImage, @"picture",
                                   nil];

[FBWebDialogs presentFeedDialogModallyWithSession:nil
                                       parameters:parameter
                                          handler:^(FBWebDialogResult result, NSURL *resultURL, NSError *error) {
                                              if (error)
                                              {
                                                  NSLog(@"Error publishing story: %@", error.description);
                                              }
                                              else
                                              {
                                                  if (result == FBWebDialogResultDialogNotCompleted)
                                                  {
                                                      NSLog(@"User cancelled.");
                                                  }
                                                  else
                                                  {
                                                      NSDictionary *urlParams = [self parseURLParams:[resultURL query]];
                                                      NSLog(@"User login");

                                                      if (![urlParams valueForKey:@"post_id"])
                                                      {
                                                          NSLog(@"User cancelled post.");

                                                      }
                                                      else
                                                      {
                                                          NSString *result = [NSString stringWithFormat: @"Posted story, id: %@", [urlParams valueForKey:@"post_id"]];
                                                          NSLog(@"result %@", result);

                                                      }
                                                  }
                                              }
                                         }];    


- (NSDictionary*)parseURLParams:(NSString *)query
{

    NSArray *pairs = [query componentsSeparatedByString:@"&"];
    NSMutableDictionary *params = [[NSMutableDictionary alloc] init];
    for (NSString *pair in pairs)
    {
        NSArray *kv = [pair componentsSeparatedByString:@"="];
        NSString *val = [kv[1] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
        params[kv[0]] = val;
    }
    return params;
}

谢谢,这是我已经在fbdialogs中使用的后备方法,它可以工作,但是标题被删掉了,我只能在我的Facebook手机应用程序中看到“…”前面的几个字符。也许我需要一些其他的解决方案,但无论如何,谢谢。我标记它为正确的,因为它似乎是最接近现有解决方案的答案。名称、描述等的字符限制是什么。?