Facebook Graph API 未返回所有事件

发布于 2024-10-18 10:51:05 字数 923 浏览 0 评论 0原文

我通过 PHP SDK 使用 Facebook Graph API 来获取附加到 Facebook 页面的事件列表。该页面有 15 个事件,全部是公开的;如果我从开发人员文档中的链接查询它们(即使用它为您提供的示例访问密钥),我可以看到所有 15 个。

该示例 URL(工作正常的 URL)是:

https://graph.facebook.com/[the name of the page]/events?access_token=[the access token]

但是,如果我通过 PHP SDK 执行相同的请求 — 即通过调用:

$facebook = new Facebook(array(
    'appId' => $fb_app_id,
    'secret' => $fb_secret,
    'cookie' => true
));

$result = $facebook->api('[the name of the page]/events');

...那么它仅返回 9 个事件,而不是完整的 15 个事件。我似乎尝试了所有参数组合:我尝试将其限制为 10、15、100、500;我尝试过设置各种offset;我设置了sinceuntil 中的一个或两者。我试图想出所有的问题:这些事件肯定是公开的,如果我在退出 Facebook 时访问该页面的“事件”选项卡,这些事件就会显示出来。无论我做什么,我都会得到同样的九个事件,用它们的不完整来嘲笑我。

有人有什么想法吗?没有显示的事件是最近添加的事件(如果这有什么区别的话),尽管它们是几天前(而不是几小时或几分钟)添加到 Facebook 的。不过,我不明白为什么这会产生影响,而且我之前也曾遇到过事件在添加后几分钟内就显示出来的情况。

预先感谢各位!

I'm using the Facebook Graph API, via the PHP SDK, to fetch a list of events attached to a Facebook page. The page has 15 events, all public; if I query them from the links in the developer documentation (i.e. with the sample access key it gives you there) I can see all fifteen of them.

That sample URL, the one that works fine, is:

https://graph.facebook.com/[the name of the page]/events?access_token=[the access token]

If, though, I do the same request via the PHP SDK — that is, from calling:

$facebook = new Facebook(array(
    'appId' => $fb_app_id,
    'secret' => $fb_secret,
    'cookie' => true
));

$result = $facebook->api('[the name of the page]/events');

…then it returns only nine events, not the full fifteen. I've tried seemingly every combination of parameters: I've tried limiting it to 10, 15, 100, 500; I've tried setting various offsets; I've set either or both since and until. I've tried to think of all the gotchas: the events are definitely public, and show up if I visit the page's "Events" tab while logged out of Facebook. Whatever I do, I just get those same nine events, mocking me with their incompleteness.

Does anyone have any ideas? The events that aren't showing are the most recently added ones, if that makes any difference, though they were added to Facebook days — rather than hours or minutes — ago. I can't think why that would make a difference, though, and I've had events show up within minutes of being added before.

Thanks in advance guys!

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

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

发布评论

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

评论(1

和我恋爱吧 2024-10-25 10:51:05

也许这个链接有帮助,向 facebook 的 bugtracker 报告了同样的问题...

http: //bugs.developers.facebook.net/show_bug.cgi?id=16617

如果不是,您必须设置“显示访客列表”标志
通过图形 API 检查该事件不可用。

Maybe this links helps, got the same problem reported to bugtracker of facebook...

http://bugs.developers.facebook.net/show_bug.cgi?id=16617

You have to set the flag "Show guestlist", if this is not
checked the event is not available via graph api.

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