0

I'm using the ActionScript-Facebook API for my project. Facebook now leaves it up to us to delete app invites once they are used.

In their documentation, they have a JavaScript snippet to do what I need to do:

FB.api(requestId, 'delete', function(response) {console.log(response);});

Cool. The AS3 API call is like such:

Facebook.api(referID, callback, "POST");

For the life of me, I'm not sure how to work this. I've tried:

Facebook.api(referID, function(){trace("callback");}, "delete");

Facebook.api(referID, function(){trace("callback");});

Facebook.api(referID, {access_token:accessTokenString}, "delete");

Here's the documentation:

https://developers.facebook.com/docs/reference/dialogs/requests/#deleting

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Ricebandit
  • 233
  • 4
  • 12
  • afaik the referID is not only the request ID but the concat of request_id and (importend) current user id, so if you dont auth the invited user you no longer can delete the request.... very stupid if you ask me. – Rufinus Nov 05 '11 at 02:30
  • without user it only seems to work with the JS call see https://developers.facebook.com/docs/reference/dialogs/requests/#deleting `DELETE https://graph.facebook.com/[_]? access_token=[USER or APP ACCESS TOKEN]` – Rufinus Nov 05 '11 at 02:33

1 Answers1

1

The following worked for removal of application requests:

var full_request_id : String = request_id + "_" + user_id;
var method : String =  "/" + full_request_id;
Facebook.deleteObject(method, callback);

@see AbstractFacebook.as The actionscript-api will then add the property 'method' with value 'delete' to the parameters of your call:

protected function deleteObject(method:String, callback:Function = null):void {
        var params:Object = {method:'delete'};
        api(method, callback, params, URLRequestMethod.POST);
    }

if (params.access_token == null) { params.access_token = accessToken; }
Lubach
  • 113
  • 7
  • Thanks, Antoine. I found the deleteObject() call a few hours (of hair-pulling) after I posted this and it worked for me. – Ricebandit Dec 09 '11 at 17:22