【问题标题】:iOS Facebook Posing Photo, URL, Message and NameiOS Facebook 摆姿势照片、URL、消息和姓名
【发布时间】:2013-01-11 15:54:11
【问题描述】:

我正在尝试将照片、URL、消息和名称从我的 iOS 应用程序发布到 Facebook 到用户的墙上。我正在使用最新的 Facebook 框架 3.1
我正在使用以下代码:

    NSDictionary* dict = @{
    @"link" : @"https://www.yahoo.com",
    @"picture" : UIImagePNGRepresentation([UIImage imageNamed:@"Default.png"]),
    @"message":@"Your message here",
    @"name" : prodName,
    @"caption" : [NSString stringWithFormat:@"Try the app: %@", prodName],
    @"description" : @"Integrating Facebook in ios"
};

[FBRequestConnection startWithGraphPath:@"me/photos" parameters:dict HTTPMethod:@"POST" completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
    NSString *alertText;
    if (error)
    {
        NSLog(@"%@",[NSString stringWithFormat: @"error: domain = %@, code = %d", error.domain, error.code]);
        alertText = @"Failed to post to Facebook, try again";
    } else
    {
        alertText = @"Posted successfully to Facebook";
    }

    [[[UIAlertView alloc] initWithTitle:@"Facebook Result" message:alertText delegate:nil cancelButtonTitle:@"OK!" otherButtonTitles:nil] show];
}];    

我可以成功发帖了。但我在 Facebook 上看到,它只发布照片和消息,而不是其他细节。如果我使用@“me/feed”,我什至无法成功发布。 Facebook 给出错误代码=5。
如何发布所有详细信息?

【问题讨论】:

    标签: ios facebook


    【解决方案1】:

    “me/feed”需要“图片”参数的 url。请看这个链接:a previous post on posting a photo on user's wall

    看来您必须决定是使用“我/照片”还是“我/饲料”。此链接将为您提供更多信息,并且可能是一种解决方法。

    【讨论】:

      猜你喜欢
      • 2015-06-11
      • 2012-06-06
      • 2012-08-27
      • 1970-01-01
      • 2012-05-31
      • 1970-01-01
      • 1970-01-01
      • 2018-02-03
      相关资源
      最近更新 更多