Reputation: 43
I am not able to submit score on leaderboard. Also, i am very new to javascript, so i dont know exactly how to catch error thrown by setScoreAsync
FBInstant.getLeaderboardAsync('global') .then(function(leaderboard) { return leaderboard.setScoreAsync(gameManager.highscore); }) .then(function(entry) { console.log(entry.getScore()); // 42 console.log(entry.getPlayer().getName()); } });
Please help me.
Upvotes: 1
Views: 570
Reputation: 58
You need to configure 'global' leaderboard in developer dashboard (with "Make leaderboard contextual" option set to 'NO'). Use:
.catch(function (err)
{
console.log(err);
});
for catching errors, the same way like .then()
Upvotes: 3