Question

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.

Was it helpful?

Solution

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

OTHER TIPS

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]

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top