Closed ceocoder closed 14 years ago
Yes, it is possible, but a bit tricky.
It depends on the access token you are using. There are two ways to do it.
var fb=new Facebook("user_access_token"); var pages = fb.GetMyPages();
foreach(var d in result.Data){ /* access your page access token using d.AccessToken */ }
d.AccessToken is the page AccessToken
u can then use that access token to post to the wall
var fb=new Facebook(d.AccessToken); fb.PostToWall("message",null);
hope this helps. in case you have any problems, please feel free to ask.
All the above methods uses the new graph api, I have also added some methods to use the old rest api.
inorder to check if the user is the admin of the page or not, u can use the old rest api to do it. var fb=new Facebook("user_access_token"); bool result = fb.AmIAdminOfPage("pageId"); or bool result = fb.IsAdminOfPage("user_id","pageid");
note: I'm using Facebook.Core and Facebook.Extensions library
thanks prabir,
first option did not work, it showed up as a post from my user acct, but second option did, thanks again.
funny, coz i use (and prefer) the first option and it works. are you sure u specified the 3rd parameter, page_id. (note: the user has to be the admin of the page, otherwise it will post as normal user.)
fb.PostToWall("message",null,page_id);
closed
i tested it and seems like facebook recently just changed it. u have to use the page access token to post as page.
Is that possible, and if so how, thanks.