用户发起的请求未删除

发布于 2024-12-07 16:23:38 字数 650 浏览 1 评论 0原文

我允许用户向其他用户发送请求,邀请他们使用我的应用程序。

请求发送得很好,受邀用户可以找到返回我的应用程序的方式。我遇到的问题是用户返回后删除请求。

首先 - 当用户单击请求时,无论他们是否与我的应用程序交互,我都想删除它。这将涉及向图表上的该对象发送 DELETE:request-id_recipient-id。但是,因为用户可能没有与我的应用程序进行交互,所以我没有他们的 user_id,所以我无法执行此操作 - 用户只能自己清理我的请求(不好)。

其次 - 即使用户确实与我的应用程序交互,我也会获取他们的用户 ID 并调用 DELETE request-id_recipient-id 我会得到以下响应:

(#200) 由 id 267270596647001 支持的实体(类 EntAppRequest) 不能当前观看者看到 500***** (EntID: 267270596647001)

这表明接收者请求无权使用其访问令牌删除它?这是正确的吗,因为它对我来说似乎有点倒退。或者在这种情况下我需要manage_requests扩展权限?这对我来说也很奇怪,因为它会向用户可能拒绝的身份验证框添加额外的权限。

编辑 - 忘记提及它是一个新应用程序,因此它使用 Requests 2.0 和 Requests 2.0 Efficient

任何帮助将不胜感激。

I'm allowing users to send requests to other users inviting them to use my app.

The requests are sent out fine and invited users can find their way back to my app. The problem I have is deleting the requests once the user returns.

Firstly - When the user clicks on the request I'd like to delete it whether they interact with my application or not. This would involved sending a DELETE to this object on the graph: request-id_recipient-id. However, because the user might not have interacted with my app I don't have their user_id so I can't do this - the user is left to clean up my request themselves (not nice).

Secondly - Even when a user does interact with my app, I get their user-id and do the call to DELETE request-id_recipient-id I get this response:

(#200) The entity (class EntAppRequest) backed by id 267270596647001 cannot be seen by the current viewer 500****** (EntID: 267270596647001)

This suggests that the recipient of a request doesn't have permission to delete it with their access token? Is this correct because it seems a bit backwards to me. Or is this a situation in which I require the manage_requests extended permission? That too would seem strange to me because it would add extra permissions to the Auth box which the user might reject.

EDIT - Forgot to mention its a new app so its using Requests 2.0 and Requests 2.0 Efficient

Any help would be appreciated.

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

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

发布评论

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

评论(3

聚集的泪 2024-12-14 16:23:38

关于第一个问题。鉴于您没有未与您的应用程序交互的用户的用户 ID,似乎无法删除发送给他们的请求。这似乎是 Facebook 请求设计中的一个“漏洞”。

然而,似乎有一种解决方法可以解决这些请求。当您使用 Javascript 发送请求时,您可以访问请求发送到的所有用户的 user_ids:

{
  request: ‘request_id’
  to:[array of user_ids]
}

您可以缓存该请求,并在预定的时间段后删除所有用户的请求。

更新:[2012 年 1 月 12 日]
此错误已在此处接受并分配 https://developers.facebook.com/bugs/202883726463009

更新:该错误已被标记为设计使然

On the first problem. Given that you do not have the user-id for users who have not interacted with you app, there seems no way to delete the request sent to them. It seems like a "hole" in the design of facebook requests.

However, there seems to be one work around to clean up the requests. When you send the request using Javascript, you have access to user_ids of all users the request was sent to:

{
  request: ‘request_id’
  to:[array of user_ids]
}

You could cache that and after some pre-determined period, just remove that requests for all users.

Update: [Jan 12th 2012]
This bug has been accepted and assigned here https://developers.facebook.com/bugs/202883726463009

Update: the bug has been marked as by design

弥繁 2024-12-14 16:23:38

如果不确切地看到您在做什么,很难知道,但这里有一些可能的解决方案:

首先,您的应用程序始终需要删除请求,与旧式请求不同,应用程序负责在接受请求后清除请求并且它们不会自动删除,因为用户接受了它们 - 此处介绍:https://developers.facebook.com/docs/reference/dialogs/requests/#deleting

您应该能够使用应用程序访问令牌来删除应用程序发送的请求无论您对接收者用户拥有什么权限(尽管根据您上面的描述,您应该可以使用您为接收者拥有的用户访问令牌):

如果您已启用“高效”请求的迁移设置,DELETE 的格式为
删除https://graph.facebook.com/[_] ?access_token=[用户或应用程序访问令牌]

如果您没有,则格式为

DELETE https://graph.facebook.com/[request_id]?access_token=[用户或应用程序ACCESS_TOKEN]

Without seeing exactly what you're doing it's hard to know, but here's some possible solutions:

First off, your app will always need to remove the request, unlike the old style requests, the app is responsible for clearing requests once they're accepted and they're not removed automatically because the user accepted them- this is covered here: https://developers.facebook.com/docs/reference/dialogs/requests/#deleting

You should be able to use an App Access token to remove a request which was sent by your app regardless of what permissions you have for the recipient user (although based on your description above you should be OK to use the user access token you have for the recipient):

If you've enabled the migration settings for 'efficient' requests, the DELETE is of the format
DELETE https://graph.facebook.com/[<request_id>_<user_id>]?access_token=[USER or APP ACCESS TOKEN]

If you haven't, it will be of the format

DELETE https://graph.facebook.com/[request_id]?access_token=[USER OR APP ACCESS_TOKEN]

沧桑㈠ 2024-12-14 16:23:38

1) 用户授权该应用后,您可以删除该请求。否则您将无法知道谁是被邀请者,因此无法知道请求 ID

2) 看来您正在尝试删除已删除的请求

1) You could delete the request once the user has authorized the app. Otherwise you would have no way of knowing who is the invitee and thus request id

2) It seems you are trying to delete a already deleted request

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