区分 Facebook 上已接受的申请请求与尚未接受的申请请求

发布于 2024-12-17 10:01:39 字数 567 浏览 2 评论 0原文

我正在为 Facebook 开发一款游戏。 我使用申请请求,也称为邀请。

我想知道是否有一种方法可以区分已接受的申请请求和尚未接受的申请请求。用户接受请求后,我通过对 Graph API 的 DELETE 调用将其删除,如文档 中所述http://developers.facebook.com/docs/reference/dialogs/requests/(删除请求部分)。但我仍然可以使用 GraphAPI 获取应用程序请求。

根本问题如下。我检查每个传入 HTTP 请求中是否存在“request_ids”HTTP 参数,并在该参数存在时执行应用程序请求处理/删除。因此,如果用户通过邀请链接来到我的应用程序并按 F5,则另一个仍包含相同“request_ids”参数的 HTTP 请求将被发送到我的应用程序。我想知道申请请求是否已经被处理。

当然,我可以在我的数据库中跟踪它。但我正在寻找一些使用 facebook API 的解决方案。

将不胜感激任何建议。

I'm developing a game for Facebook.
I use application requests, also known as invites.

I'm wondering if there is a way to distinguish accepted application request from not yet accepted. After a user accepts the request, I delete it via DELETE call to Graph API as described in documentation http://developers.facebook.com/docs/reference/dialogs/requests/ (section Deleting Requests). But I still can GET the application request using GraphAPI.

The root issue is the following. I check the presence of "request_ids" HTTP-param in every incoming HTTP-request and perform app-request processing/deleting if the param is present. So, if the user came to my application by an invite link and hit F5, another HTTP-request still containing same "request_ids" param will be sent to my application. Here I would like to know if the application request has already been processed.

Of course I can track it in my database. But Im looking for some solution using facebook APIs.

Would appreciate any advice.

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

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

发布评论

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

评论(1

空心空情空意 2024-12-24 10:01:40

当然,我可以在我的数据库中跟踪它。但我正在寻找一些
使用 Facebook API 的解决方案。

为什么?在您发布的同一链接上,明确表明这是的责任:

当用户通过单击请求定向到您的应用程序时
从应用程序、游戏仪表板或请求
通知,您必须在请求被接受后将其删除。
点击请求后不会自动删除
因此,开发人员有责任一旦发现它们,就将其清除。
被消耗掉了。

现在我认为向用户特定的应用程序请求发出 DELETE 请求实际上会使该特定应用程序请求的未来 GET 调用无效。但即使情况并非如此,您也应该处理此类情况。

Of course I can track it in my database. But Im looking for some
solution using facebook APIs.

Why? on the same link you posted, it's make clear that it's your responsibility:

When a user is directed to your application, by clicking a Request
from the application, the games dashboard, or from a Request
notification, you must delete the request after it has been accepted.
Requests are not automatically deleted once they have been clicked,
thus it is the developer’s responsibility to clear them once they have
been consumed.

Now I thought that issuing a DELETE request to a user specific apprequest would actually invalidate future GET calls for this particular apprequest. But even if that's not the case, you should be handling such cases.

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