Wondering how to delete (or) remove a post (or) comment from a facebook fan page wall, here it is!
///<summary\>
/// Remove post from facebook fanpage wall
///</summary\>
///<param name="accesstoken"\>user access token</param>
///<param name="fanPageId"\>Fan Page Id</param>
///<param name="contentId"\>Post or Comment Id </param>
public void removePost(string accesstoken, string fanPageId, string contentId)
{
var fb = new FacebookClient();
dynamic parameters = new ExpandoObject();
parameters.access_token = accesstoken;
parameters.uid = fanPageId;
//pass the content id you like to remove - pageid_postid format
if(fb.Delete("/" + contentId, parameters))
{
Console.Write("Delete Success!");
}
else
{
Console.Write("Delete failed!");
}
}
Call this method and the content is cleaned (removed) from your fanpage wall.
Happy coding!
///<summary\>
/// Remove post from facebook fanpage wall
///</summary\>
///<param name="accesstoken"\>user access token</param>
///<param name="fanPageId"\>Fan Page Id</param>
///<param name="contentId"\>Post or Comment Id </param>
public void removePost(string accesstoken, string fanPageId, string contentId)
{
var fb = new FacebookClient();
dynamic parameters = new ExpandoObject();
parameters.access_token = accesstoken;
parameters.uid = fanPageId;
//pass the content id you like to remove - pageid_postid format
if(fb.Delete("/" + contentId, parameters))
{
Console.Write("Delete Success!");
}
else
{
Console.Write("Delete failed!");
}
}
Call this method and the content is cleaned (removed) from your fanpage wall.
Happy coding!