问题
I've looked through this site and looked at the Facebook docs but I can't seem to delete an invite after a friend accepts. So, what happens is: 1. Steve invites John to a game. 2. John receives that invite and clicks accept. 3. John is taken to the game, but the invite message is not delete in his facebook page.
Facebook docs suggests I add "method=delete" when I post to https://graph.facebook.com/[request_id]?access_token=xxxx
But that returns me "{"error":{"type":"OAuthException","message":"(#2) Invalid parameter: Unknown error"}}
". I'm pretty sure I'm using the most recent access_token.
Can anyone provide me with sample code which deletes an application invite after a user accepts?
EDIT:
I also tried DELETE i.e. DELETE https://graph.facebook.com/[request_id]?access_token=xxxx
And I get the same error
Thanks.
回答1:
There's brief examples at https://developers.facebook.com/docs/reference/dialogs/requests/ and a longer example on https://developers.facebook.com/blog/post/464/ which show how to do this.
It sounds from your comments on fjsj's answer that you know what you're supposed to be doing - it definitely looks OK to me.
It could be that you're encountering a bug of some kind, but I think in this case it's more likely that somehow the access token of the user is being sent or there's a slight error in the way you're accessing the API - If there's a specific error message you're getting back? maybe post that here if there is.
Two things to check:
Is the request you're trying to delete returned when you make a GET request to
/<request id>
? (using the app access token)Are the requests being sent using the newer Requests 2.0 dialogs? If you're using the older requests system, the instructions are basically the same, but the connection you access the requests at is the [currently undocumented]
/<USER>/platformrequests
endpoint (as opposed to/<USER>/apprequests
回答2:
Try doing a HTTP DELETE instead of a POST. This is what the documentation says.
来源:https://stackoverflow.com/questions/7287347/cannot-delete-application-invite-in-facebook-after-acceptance