wardaddy
wardaddy

Reputation: 43

failed to submit Leaderboard score in facebook instant games

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

Answers (1)

Bartek Sokolowski
Bartek Sokolowski

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

Related Questions