I use Facebook PHP SDK 3.0.1 (latest currently). What I need to be able to do is to post as a the identity of the Page on the Page.
I tried replacing the access_toke
1.First you have to get the page access token.
public function getPageToken()
{
$page_id = "xxxxxxxxxx";
$page_access_token = "";
$result = $this->facebook->api("/me/accounts");
if( !empty($result['data']) )
{
foreach($result["data"] as $page)
{
if($page["id"] == $page_id)
{
$page_access_token = $page["access_token"];
break;
}
}
}
else
{
$url = "https://www.facebook.com/dialog/oauth?client_id=xxxxxxxxxx&redirect_uri=http://apps.facebook.com/xxxxxx&scope=manage_pages&response_type=token";
echo "";
}
return $page_access_token;
}
2.After getting the page access token just include that token in your post to wall code.
3.Remember this code will only publish your post on Fan page's wall and users who liked the fan page will be able to see that post as the post is posted on their own feed.
Hope this will solve your problem.