Deleting a comment on Facebook is much the same process as for deleting any other Graph API object with the same restrictions.
In this recipe, we're going to take the end result from the previous recipe, which uses a List component and item renderers to present the comments for a Graph API object and to these Item Renderers we'll add functionality to delete comments.
To introduce the delete capability to our application, we should add a Button component to the FacebookCommentItemRenderer
class with an ID of delete_btn
.
To delete the comment from the Graph API, we make a request with the comment's ID, with a request options object that includes the property method
with the value of 'delete'
, as follows:
var option:Object = new Object(); option.method = "delete"; Facebook.api(COMMENT_ID, responseHandler, option, "post");
1. Into our existing Item Renderer, we should add a click event handler for the
delete_btn
component, which makes this request...