In this time I implement Facebook Ignited library to my application Public Ads. Facebook connect/login with no problems. But when i want publish customer ad to their facebook timeline everytime I get result:
scope for FB application Email only
fb_feed() - Facebook::api() exception caught: (#200) The user hasn't authorized the application to perform this action
with scope publish_actions
fb_feed() - Facebook::api() exception caught: An unknown error has occurred.
Where I make mistake? Which scope permissions are needed for method fb_feed('post')?
Here is my code:
$params = array(
"message" => "Message for customer's friends",
"link" => "http://www.mywebpage.com/ads/iphone4s/12312",
"picture" => "http://image.mywebpage.com/lHkOsiH.png",
"name" => "Sample title for ad",
"caption" => "www.mywebpage.com",
"description" => "Sample text of customer ad."
);
try {
$this->fb_me = $this->fb_ignited->fb_get_me();
} catch(FBIgnitedException $e) {
echo $e->getMessage();
}
if ($this->fb_me) {
try {
$feed_id = $this->fb_ignited->fb_feed('post',null, $params);
} catch(FBIgnitedException $e) {
echo $e->getMessage();
}
}
This required the extended permission publish_stream while doing the authentication in the scope param.
So you need to add the scope publish_stream not just email
https://developers.facebook.com/docs/php/howto/postwithgraphapi/
https://developers.facebook.com/docs/reference/login/extended-permissions/
Here is an nice article to see the different scopes and which one is having higher precedence over other
http://globalspin.com/2013/06/publish_stream-vs-publish_actions/