Facebook ios-sdk:提要帖子不显示在动态消息上

发布于 2024-10-15 19:00:44 字数 1597 浏览 2 评论 0原文

我尝试发布一条消息来供稿,但她只显示在个人资料中。

如何使此消息显示在新闻源和个人资料源上?

这是我的示例代码:

SBJSON *jsonWriter = [[SBJSON new] autorelease];

NSDictionary* actionLinks = [NSArray arrayWithObjects:[NSDictionary dictionaryWithObjectsAndKeys:
                                                       _gameName,@"text",_gameLink,@"href", nil], nil];

NSString *actionLinksStr = [jsonWriter stringWithObject:actionLinks];


NSDictionary* imageShare = [NSDictionary dictionaryWithObjectsAndKeys:
                            @"image", @"type",
                            _imageURL, @"src",
                            _gameLink, @"href",
                            nil];


NSDictionary* attachment = [NSDictionary dictionaryWithObjectsAndKeys:
                            title_, @"name",
                            //@"teste", @"caption",
                            _msg, @"description",
                            [NSArray arrayWithObjects:imageShare, nil ], @"media",
                            _gameLink, @"href", nil];

NSString *attachmentStr = [jsonWriter stringWithObject:attachment];

NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                               @"Share on Facebook",  @"user_message_prompt",
                               actionLinksStr, @"action_links",
                               attachmentStr, @"attachment",
                               nil];


[_facebook dialog:@"feed" andParams:params andDelegate:self];

如果我尝试使用不带参数的方式发布,则消息会显示在两者中:

[_facebook dialog:@"feed" andDelegate:self];

I try to post a message to feed, but her show only in profile.

How to do make this message show on news feed and profile feed?

This is my sample code:

SBJSON *jsonWriter = [[SBJSON new] autorelease];

NSDictionary* actionLinks = [NSArray arrayWithObjects:[NSDictionary dictionaryWithObjectsAndKeys:
                                                       _gameName,@"text",_gameLink,@"href", nil], nil];

NSString *actionLinksStr = [jsonWriter stringWithObject:actionLinks];


NSDictionary* imageShare = [NSDictionary dictionaryWithObjectsAndKeys:
                            @"image", @"type",
                            _imageURL, @"src",
                            _gameLink, @"href",
                            nil];


NSDictionary* attachment = [NSDictionary dictionaryWithObjectsAndKeys:
                            title_, @"name",
                            //@"teste", @"caption",
                            _msg, @"description",
                            [NSArray arrayWithObjects:imageShare, nil ], @"media",
                            _gameLink, @"href", nil];

NSString *attachmentStr = [jsonWriter stringWithObject:attachment];

NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                               @"Share on Facebook",  @"user_message_prompt",
                               actionLinksStr, @"action_links",
                               attachmentStr, @"attachment",
                               nil];


[_facebook dialog:@"feed" andParams:params andDelegate:self];

If I try to post using without params, the message show in both:

[_facebook dialog:@"feed" andDelegate:self];

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

禾厶谷欠 2024-10-22 19:00:44

试试这个:

NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                               @"some text", @"message",
                               nil];


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

我希望它有帮助。
有关更多参数,请阅读 post params

Try this:

NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                               @"some text", @"message",
                               nil];


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

I hope it is help.
For more parameters read post params

凝望流年 2024-10-22 19:00:44

抱歉,这不显示对话框。

我通过删除并重新创建应用程序来解决。

Sorry, but this don't show dialog box.

I solved by deleting and recreating the application.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文