AS3 API: Deleting App Invites

亡梦爱人 提交于 2019-12-06 15:45:31

问题


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


回答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; }


来源:https://stackoverflow.com/questions/8016668/as3-api-deleting-app-invites

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!