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!
Thanks a lot buddy it works for me after some modification in the code
ReplyDeleteif(fb.Delete(contentId, parameters))
Hello Im Osama from MyRouter you can now use MyRouter for virtual router for more details please visit our website
ReplyDeletehttp://myroutervwr.info/
thank you very much