Reputation: 18600
Facebook Login URL Code :
$this->set("facebookUrl",$this->facebook->getLoginUrl(
array(
'scope' => 'email,publish_actions',
'redirect_uri' =>"http://redirected_url"
'display'=>"popup"
)
));
Post story on facebook code :
$params = array(
"access_token" => "access_token_of_logged_in_user",
"message" => "Testing facebook post",
"picture" => "https://i.sstatic.net/Og6yH.jpg?s=128&g=1",
"caption" => "www.pontikis.net",
"description" => "Description of post."
);
$myProfile = $this->facebook->api('/me');
$permissions = $this->facebook->api('/me/permissions');
pr($permissions);
try {
$ret = $this->facebook->api('/'.$myProfile['id'].'/feed', 'POST', $params);
echo 'Successfully posted to Facebook';
}
catch(Exception $e) {
echo $e->getMessage();
}
Permission Displayed here :
Array
(
[data] => Array
(
[0] => Array
(
[permission] => public_profile
[status] => granted
)
[1] => Array
(
[permission] => email
[status] => granted
)
)
)
I got following Error when I post on facebook :
(#200) The user hasn't authorized the application to perform this action
Upvotes: 0
Views: 5004
Reputation: 31479
If you're using Graph API >=v2.0, then you need to pass Login Review for non admin/tester/developer users before you can use this permission in your app:
See
Upvotes: 2