- Home /
google play leaderboards help?
hello,
I am new to social media integration and I have built an entire game in unity JS. I am trying to send a score to the leaderboard with a JS script using the following code:
#pragma strict
import GooglePlayGames;
import UnityEngine.SocialPlatforms;
function Update () {
if ( game.score > game.highscore ){
game.highscore = game.score;
PlayerPrefs.SetInt("game.highscore", game.score);
Social.ReportScore(game.highscore, "leaderboard ID", (sucess : boolean) => {
// handle success or failure
Debug.Log ("posted");
});
}
else {game.highscore = game.highscore;}
}
This is creating a few errors - (9,70): BCE0044: expecting ), found ':', and also (9,72): BCE0044: expecting ), found 'boolean'.
can anyone help me with this implementation in JS? Any help will be greatly appreciated.
Answer by mealone · Jun 25, 2015 at 04:47 AM
fixed by enabling the drive API in the console
Your answer
![](https://koobas.hobune.stream/wayback/20220613201123im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
(Crash) on calling Google Authentication 2 Answers
Social.ShowLeaderboardUI not showing up on MacOS Standalone 0 Answers
Google Play Games Plugin(A simple issue) 0 Answers
Can't see public leaderboard from google play 1 Answer
Can sign in using Google Play Games Plugin, but unable to load scores from the leaderboard 2 Answers