3

我正在使用以下代码在当前用户提要上发布帖子:

   NSMutableDictionary *postParams = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
                                   @"http://url.com/image.jpg", @"picture",
                                   @"The title of the post on the feed", @"name",
                                   @"Caption text", @"caption",
                                   @"Description text", @"description", nil];

   [self.facebook requestWithGraphPath:@"me/feed" andParams:postParams andHttpMethod:@"POST" andDelegate:nil];

它工作得很好,但我不知道如何设置帖子名称后面的链接(“提要上帖子的标题”)。目前,该链接如下所示:

https://www.facebook.com/connect/uiserver.php?app_id=[MY_APP_ID]&method=permissions.request&redirect_uri=[THE_URL_OF_THE_PICTURE]&response_type=code&display=page&auth_referral=1

有没有办法轻松控制这个网址?谢谢!

- 编辑 -

这是我要创建的一种帖子的屏幕截图: 在此处输入图像描述

http://cl.ly/image/020D1z3S2L16。蓝色标题“Je t'ai envoyé un défi dans Années 80”后面的链接非常干净(就像http://itunes.apple.com/app/[APP_NAME]一样),我也想这样做。

我相信这不是一个开放的图表动作,只是一个基本的帖子。谢谢

4

4 回答 4

2

Graph API 参考https://developers.facebook.com/docs/reference/api/post/中概述了 Facebook 提要的所有参数。

相关的是“名称”、“标题”、“描述”或“消息”。因此,如果您所指的元素不受影响,则您无法控制它。

于 2012-09-01T15:16:26.523 回答
2

Hey Its very easy just try this code.

 NSMutableDictionary *params = [NSMutableDictionary dictionary] ;
    [params setObject:@"Test post" forKey:@"message"];
    [params setObject:@"link" forKey:@"type"];
    [params setObject:@"http://yoursite.com" forKey:@"link"];
    [params setObject:@"Link description" forKey:@"description"];


    // Make the request
    [FBRequestConnection startWithGraphPath:@"/me/feed"
                                 parameters:params
                                 HTTPMethod:@"POST"
                          completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
                              if (!error) {

                                  if(appDelegate.isLoggedInWithTwitter)
                                  {
                                      [self postMessage:_lblTitle.text];
                                  }
                                  else
                                  {
                                      [self toggleProgressHud:NO title:@"" message:@""];
                                      NSLog(@"%@",[NSString stringWithFormat:@"result: %@", result]);
                                      UIAlertView *alertMsg=[[UIAlertView alloc]initWithTitle:nil message:@"Shared Successfully" delegate:self cancelButtonTitle:nil otherButtonTitles:@"Ok", nil];
                                      alertMsg.tag=11;
                                      alertMsg.delegate=self;
                                      [alertMsg show];
                                  }
                                  // Link posted successfully to Facebook
                              } else {
                                  // An error occurred, we need to handle the error
                                  // See: https://developers.facebook.com/docs/ios/errors
                                  NSLog(@"%@",[NSString stringWithFormat:@"%@", error.description]);
                                  [self toggleProgressHud:NO title:@"" message:@""];
                                  [self handleAPICallError:error];
                              }
                          }];

And here is the result which you want

enter image description here

于 2014-02-28T07:09:38.407 回答
1
于 2012-09-04T10:02:54.113 回答
1

"xx shared a link" cannot be controlled through a post. Facebook is performing tons of A/B testing to decide what to display...

于 2012-09-13T09:09:59.320 回答