Note that there are some explanatory texts on larger screens.

plurals
  1. POCan't publish a high score to player's timeline on Facebook
    primarykey
    data
    text
    <p>I'm developing a PHP game and would like to post players highscores to their own facebook wall /timeline.</p> <p>I've set up a Facebook App and the PHP code I'm using to POST the score is (as provided by Facebook itself):</p> <pre><code>&lt;?php require 'facebook-sdk/facebook.php'; $app_id = MY_APP_ID; $app_secret = MY_APP_SECRET; $score = 1500; // this is gonna be passed someway... $facebook = new Facebook(array( 'appId' =&gt; $app_id, 'secret' =&gt; $app_secret, )); $user = MY_USER_ID; // to be replaced with a call to $facebook-&gt;getUser() $app_access_token = get_app_access_token($app_id, $app_secret); $facebook-&gt;setAccessToken($app_access_token); $response = $facebook-&gt;api('/' . $user . '/scores', 'post', array( 'score' =&gt; $score, )); print($response); // Helper function to get an APP ACCESS TOKEN function get_app_access_token($app_id, $app_secret) { $token_url = 'https://graph.facebook.com/oauth/access_token?' . 'client_id=' . $app_id . '&amp;client_secret=' . $app_secret . '&amp;grant_type=client_credentials'; $token_response =file_get_contents($token_url); $params = null; parse_str($token_response, $params); return $params['access_token']; } ?&gt; </code></pre> <p>Of course there is a login and install section which I have omitted, asking the user to login and grant '<code>publish_stream</code>' and '<code>publish_actions</code>' privileges to the app.</p> <p>This is working with success, the response variable outputs 1. I can see the posted score using the Facebook Graph API Explorer so I assume everything is really working fine and smooth.</p> <p>The problem is that I am not able to see the supposedly posted user-story anywhere on Facebook. Reading the documentation it seems to me that a user story has to be automatically published when one saves a score. As an example, have a look <a href="https://developers.facebook.com/blog/post/2012/03/05/games-update--expanding-distribution-for-scores-and-achievements/" rel="noreferrer">here</a> or <a href="https://developers.facebook.com/docs/guides/games/getting-started/#step4" rel="noreferrer">here</a>.</p> <p>Does anyone solved this problem already? Do you see something that I might have missing? Can you please point me at the right direction to solve this issue?</p> <p>Any help will be highly appreciated.</p>
    singulars
    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.
 

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