iOS开发:如何在朋友的新闻资讯中获得Facebook墙贴? [英] iOS Development: How can I get a Facebook wall post to show in the friend's news feed?

查看:150
本文介绍了iOS开发:如何在朋友的新闻资讯中获得Facebook墙贴?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将Facebook整合到iPhone应用程序中,并且我有代码可以在登录后将其发布到用户的墙上,但是我注意到该帖子并未显示在用户的新闻Feed中由用户的朋友。相反,它只会显示在用户的墙上。这是我的代码...

I'm integrating Facebook into my iPhone app and I have the code working to publish a post to the user's wall after they login, but I've noticed that the post doesn't show up in the user's news feed that's seen by the user's friends. Instead, it only shows up on the wall of the user. Here's my code...

- (void)publishStream 
{
 NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
           @"Post a message on your wall",  @"user_message_prompt",
           @"Hello, World!", @"message",
           nil];

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

如何在新闻提要中显示?我应该提到,我唯一的许可是publish_stream,据我所知,这是我唯一需要的权限。

How can I have it show up in the news feed as well? I should mention that the only permission I have set is 'publish_stream' which, as I understand it, is the only permission I need.

非常感谢你的智慧!

推荐答案

你需要发布给你的朋友的feed,简单的方法是适应你的代码,使用适当的图形方法与你想发布到Facebook ID的人(我已经在这里假设你已经从以前的一个电话中存储了这个图表api in person.facebookID)

You need to post to your friends feed, Easy way would be to adapt your code to use the appropriate graph method with the persons you wish to post to facebook ID (i've assumed here you have stored this from an earlier call the graph api in person.facebookID)

[facebook requestWithGraphPath:[NSString stringWithFormat:@"%@/feed/",person.facebookID] andParams:params andHttpMethod:@"POST" andDelegate:self

http://开发人员.facebook.com / docs / reference / api / post

要获取用户列表的朋友使用图形路径我/朋友

To get a list of the users friends use the graph path me/friends

[facebook requestWithGraphPath:@"me/friends" andDelegate:self];

哪些会将用户的朋友姓名和他们的Facebook ID的JSON列表返回给相应的委托方法从FBRequest,它可能值得将这组结果包装到一组人物对象或存储返回的NSDictionary,以便您可以检索个人的朋友,它直到你如何处理返回的朋友的列表(你可能想使用UITableView根据用户的其他一些输入显示用户的朋友或过滤器)

Which will return a JSON list of the users friends names and their Facebook ids, to the appropriate delegate method from FBRequest, its probably worth wrapping this set of results into a set of person objects or storing the returned NSDictionary so that you can retrieve individual friends, its upto you how you process the list of returned friends (you probably want to use a UITableView to display the user friends or filter based on some other input from the user)

使用此方法将意味着您不必在iOS sdk中使用Facebook对话框,确实意味着用户可以使用您的应用程序在一天内发布多少消息的上限

Using this method will mean you do not have to use the Facebook dialogs in the iOS sdk, which does mean there is an upper limit to how many messages the user can post in a day using your app

如果您希望使用对话框,则需要包含 target_id,并将其设置为要发布到

If you wish to use a dialog you will need to include the "target_id" in your params dictionary and set this to the persons Facebook ID you wish to post to

这篇关于iOS开发:如何在朋友的新闻资讯中获得Facebook墙贴?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆