1

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.

wardaddy
  • 43
  • 5

1 Answers1

3

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()