Note that there are some explanatory texts on larger screens.

plurals
  1. POFacebook Open Graph - post to all approved users feeds
    text
    copied!<p>I'm struggling to get to grips with posting a feed item to all the members of an approved application.</p> <p>Within the application settings for the user it is stating that the application has permission to post to the wall but I can only achieve this if that user is currently logged in to facebook. Obviously I would like this to function so that any items I uploaded are posted to all the members of the application at any one time.</p> <p>I am using the Facebook PHP SDK from <a href="http://github.com/facebook/php-sdk/" rel="nofollow noreferrer">http://github.com/facebook/php-sdk/</a> and currrently my code is as follows:</p> <pre><code> require 'src/facebook.php'; //Generates access token for this transaction $accessToken = file_get_contents("https://graph.facebook.com/oauth/access_token?type=client_cred&amp;client_id=MyAppId&amp;client_secret=MySecret"); //Gets the full user details as an object $contents = json_decode(file_get_contents("https://graph.facebook.com/SomeUserId?scope=publish_stream&amp;" . $accessToken)); print_r($contents); if ($facebook-&gt;api('/' . $contents-&gt;id . '/feed', 'POST', array( 'title' =&gt; 'New and Improved, etc - 12/03/2010', 'link' =&gt; 'http://www.ib3.co.uk/news/2010/03/12/new-and-improved--etc', 'picture' =&gt; 'http://www.ib3.co.uk/userfiles/image/etc-booking.jpg', 'scope' =&gt; 'publish_stream' ) )==TRUE) { echo "message posted"; } else { echo "message failed"; } </code></pre> <p>The output from <code>$contents</code> shows the expected user details but nothing relating to the permissions for my application. Am I missing a trick here?</p> <p>Then using the <code>$facebook-&gt;api()</code> function I am receiving a </p> <blockquote> <h1>200 - Permissions error</h1> </blockquote> <p>. The application does not have permission to perform this action.</p> <p>This is driving me a little potty as I suspect I'm missing something straightforward with the authorisation but what?</p> <p>Many thanks in advance for an assistance offered.</p>
 

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