1

I'm trying to verify following's link facebook. I need that user can't access to information without follow "X".

My problem is with permissions, I give to the app "publish_actions'permisions but I obtaint this error:

Uncaught OAuthException: (#200) Requires extended permission: publish_actions thrown in...

This is my code:

require_once("./facebook/facebook.php");

$config = array();
$config['appId'] = '';
$config['secret'] = '';
$config['fileUpload'] = false; // optional

$facebook = new Facebook($config);

if ( $facebook->getUser() )
    echo '<a href="'. $facebook->getLogoutUrl() . '">Cerrar sesión en Facebook</a>';
else
    echo '<a href="'. $facebook->getLoginUrl() . '">Iniciar sesión en Facebook</a>';


echo '<pre>';
var_dump($facebook->api('/me/og.likes','POST',array('object' => "http://samples.ogp.me/226075010839791")));
echo '</pre>';
  • When you debug your access token, are you **sure** you have the publish_actions permission? you cannot post open graph actions without this permission, and if the actions aren't approved, you can only post those actions from the accounts of your app's admins and testers – Igy Jul 24 '13 at 19:31
  • finally i solved my problem with this post: http://stackoverflow.com/questions/5093398/how-to-check-if-a-user-likes-my-facebook-page-or-url-using-facebooks-api –  Jul 24 '13 at 19:58
  • That question has little to no relationship to what you said was the problem here, which seemed to be related to posting open graph likes. – Igy Jul 24 '13 at 21:48

1 Answers1

0

The parameters for getLoginUrl are empty. It should be as follows

$params = array(
  'scope' => 'publish_actions'
);

echo '<a href="'. $facebook->getLoginUrl($params); . '">Iniciar sesión en Facebook</a>';

See https://developers.facebook.com/docs/reference/php/facebook-getLoginUrl/ and https://developers.facebook.com/docs/facebook-login/permissions/#adding

phwd
  • 19,975
  • 5
  • 50
  • 78