Note that there are some explanatory texts on larger screens.

plurals
  1. POadding like comment issue using graph api
    primarykey
    data
    text
    <p>i have put last 3 posts in web page , if user loged in he can add comment / like , problem is if user loged in and try add like or comment he is getting an permission error #200 , if i loged in i can add like or comment (application is for me) , am getting the all permission nedded from the user , so how can i give him permission to add like / comment.</p> <p>CODE : </p> <pre><code>$facebook = new Facebook(array( 'appId' =&gt; '', 'secret' =&gt; '', 'cookie' =&gt; true, )); $user = $facebook-&gt;getUser(); if ($user) { if (session_id()) { } else { session_start(); } $access_token = $facebook-&gt;getAccessToken(); //check permissions list $permissions_list = $facebook-&gt;api( '/me/permissions', 'GET', array( 'access_token' =&gt; $access_token ) ); //check if the permissions we need have been allowed by the user //if not then redirect them again to facebook's permissions page $permissions_needed = array('publish_stream', 'read_stream', 'manage_pages'); foreach ($permissions_needed as $perm) { if (!isset($permissions_list['data'][0][$perm]) || $permissions_list['data'][0][$perm] != 1) { $login_url_params = array( 'scope' =&gt; 'publish_stream,read_stream,manage_pages', 'fbconnect' =&gt; 1, 'display' =&gt; "page", 'redirect_uri' =&gt; 'http://localhost/fb/index.php', ); $login_url = $facebook-&gt;getLoginUrl($login_url_params); header("Location: {$login_url}"); exit(); } } }else { //if not, let's redirect to the ALLOW page so we can get access //Create a login URL using the Facebook library's getLoginUrl() method $login_url_params = array( 'scope' =&gt; 'publish_stream,read_stream,manage_pages', 'fbconnect' =&gt; 1, 'display' =&gt; "page", 'redirect_uri'=&gt;'http://localhost/fb/index.php', ); $login_url = $facebook-&gt;getLoginUrl($login_url_params); //redirect to the login URL on facebook header("Location: {$login_url}"); exit(); } $logoutUrl = $facebook-&gt;getLogoutUrl(); </code></pre> <p><strong>and if the user click on like button :</strong> </p> <pre><code> jQuery('ul.fb_list a').click(function(){ var comm_id = jQuery(this).attr("class"); jQuery.post('https://graph.facebook.com/'+comm_id+'/likes/',{ access_token : "&lt;?php echo $access_token ?&gt;" }); }); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload