I want to submit a score from the JavaScript SDK. Here's my current attempt:
FB.api("/me/scores", 'post', {score: seconds, access_token: FB.getSession().access_token}, function(response){
if (!response || response.error) {
console.error(response);
} else {
console.log(response);
}
});
I get the error message:
(#15) This method must be called with an app access_token.
Since I am passing the access token, why doesn't this work?
Thanks.
The Facebook SDK for JavaScript provides a rich set of client-side functionality that: Enables you to use the Like Button and other Social Plugins on your site. Enables you to use Facebook Login to lower the barrier for people to sign up on your site. Makes it easy to call into Facebook's Graph API.
Facebook only uses one language in the Front-end that is JavaScript. JavaScript is the most popular programming language today as it is used by almost every platform in the front-end development that you visit today.
You need to use an app access_token to update score, which is different from session or user token.
http://developers.facebook.com/docs/authentication/#applogin
2ndly you will need to use the session or user token to read the scores, then use an app token to delete.
http://developers.facebook.com/docs/reference/api/application/#scores
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With