当使用Facebook图API API拉一个帖子时,并不是所有的评论都可见 [英] Not all the comments visible when pulling a post using Facebook graph API iphone

查看:163
本文介绍了当使用Facebook图API API拉一个帖子时,并不是所有的评论都可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我搜索了所有关于Facebook图形API的帖子,并没有找到任何内容。这是问题。

I searched through all the posts about Facebook graph API and didn't find anything about it. Here's the issue.

我正在为一家公司工作iPhone应用程序。对于这个应用程序的新闻部分,我使用Facebook图形API从该公司的Facebook页面的墙上提取所有的帖子和评论。
我这样做的方式是:首先我通过发送请求拉出所有的帖子:

I'm working on the iPhone app for one company. And for the news section in this app, i'm pulling all the posts and comments from the wall of this company's Facebook page using Facebook graph API. The way i do this is: first i pull all the posts by sending request:

[facebook requestWithGraphPath:@"company name/feed" andDelegate:self];

我收到所有的帖子和信息的NSDictionary,包括评论的数量。我把所有的帖子放在tableView中,当你点击其中一个postController的评论打开。我要求对这篇文章发表评论:

And I receive the NSDictionary with all posts and information about it, including number of comments. I put all the post in tableView and when you tap one of the posts viewController of comments opens. Where i requesting the comments for this post:

NSString *postId = [self.post objectForKey:@"id"];
NSString *request = [NSString stringWithFormat:@"%@/comments" ,postId];
[facebook requestWithGraphPath:request andDelegate:self];

我正在收到注释数组。但其中有些缺失。我猜这是因为他们帐户中有一些隐私设置。

我只是想知道有人有同样的问题,知道如何工作。或者知道用户需要在他的Facebook帐户中改变哪些隐私设置才能看到他的评论。

I'm receiving the array of comments. But some of them are missing. I guess it because of some privacy setting people have in their accounts.
I'm just wondering maybe someone had the same issue and know how to work this around. Or know what privacy settings user need to change in his facebook account to be able to see his comments.

谢谢。

推荐答案

只是想添加此作品:抓取所有基本墙贴信息的Feed,然后单独获取每个帖子的评论。需要更复杂的刷新方法,还有一点诡计(相信您的注释数组可以通过JSON注释计数),但至少可以正确使用。

Just wanted to add this works: Grab the feed for all the basic wall post information, then grab the comments for each post individually. Requires more complex refresh methods, and a little trickery (trust your comments array over the JSON comment count number where you can) but at least it gets it right.

em>抓住Feed以获取post_id,然后单独抓取每个帖子以获取正确的信息。然而,就在2天前,我有一些非常有趣的东西,在iOS上的同样的Facebook发布请求将返回3的评论中的2个,Chrome浏览器返回1评论(最新的),Firefox中的请求返回另外2评论,但不是最新的。使用浏览器测试响应时,如果我没有登录,则无关紧要。这发生在大约一半的帖子和评论。

I was grabbing the feed to get post_id's, then grabbing each post individually to get the correct information. However, just 2 days ago I had some really funny stuff going on where the same facebook post request in iOS would return 2 of the 3 comments, the Chrome browser returned 1 comment (the latest one) and the request in Firefox returned the other 2 comments but not the newest one. Didn't matter if I was logged in or not when using the browser to test the response. This happened for about half the posts with comments.

所以我尝试使用访问令牌在Facebook开发人员网站上的URL,并将请求更改为这个特定的帖子 - 返回所有正确的信息直接!到目前为止,我甚至创建了一个新的Facebook应用程序来获取新的应用程序ID,并在XCode中创建一个新项目,以消除所有可能性 - 没有任何改变。

So I tried using the access token in the URLs on the Facebook Developers site and changing the request to this particular post - returned all the correct information straight away! It got to the point where I even created a new Facebook App to get a new app ID, and a fresh project in XCode to eliminate all possibilities - didn't make a difference.

所以感谢这个线程,我尝试了{post_id} / comments GET,它的工作正常。我已经做了同样的事情,喜欢消除这一点,潜在的进一步下线!

So thanks to this thread I tried the {post_id}/comments GET, and it works correctly. I've done the same thing for likes to eliminate that potentially breaking further down the line as well!

这篇关于当使用Facebook图API API拉一个帖子时,并不是所有的评论都可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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