Reputation: 1214
I am using Facebook PHP SDK v5 graph 2.4.
With the code below I can successfully post to my own page, but how can I set it to post to my fan page?
try {
$response = $fb->post('/me/feed', $params, $access_token);
} catch(Facebook\Exceptions\FacebookResponseException $e) {
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
}
$graphNode = $response->getGraphNode();
I tried substituting my fan page id into it:
$response = $fb->post('/229107363768163/feed', $params, $access_token);
but I get the following error:
Graph returned an error: Unsupported post request.
EDIT: It seems I need a page access token?? Can someone please show me how?
Please help!
Upvotes: 0
Views: 180
Reputation: 472
1.If you want to Post to a Fan's page then your App should be approved by Facebook's Team.
Upvotes: 1