I am developping my first facebook social game in PHP and I follow the social game tutorial provided on developer.facebook.com
My game is on a server and loaded into a canvas page.
Everything is clear but I can't resolve a problem when I try to deal with achievements: http://developers.facebook.com/docs/guides/games/getting-started/#step6
I was able to create, register and save achievements but I get an error when I try to consult the achievements my user had already earned. The code is this one:
function getAchievements() {
FB.api('/me/achievements', function(response) {
for(var i = 0; i < response.data.length; i++) {
...
}
...
});
In my console, if I trace the response
object, I see there is an authentication error:
response : {
"error": {
"message": "An active access token must be used to query information about the current user.",
"type": "OAuthException",
"code": 2500
}
}
I've tried a lot of things but I can't resolve this problem.
The user is logged, I've asked for email,publish_actions
permissions, I've tried to add the user_games_activity
extended permission... :(
Does someone know what is going on with this particular FB.api call?