Question by
Ted24 · Oct 20, 2015 at 03:51 PM ·
error messagesocial
Problem with Social.ReportScore
Hi all!
Can't figure out a problem. I have registered "leaderboard01" (public string leaderboardID = "leaderboard01"; ) in itunesconnect, next code goes well:
void Start () {
DoLeaderboard ();
}
void DoLeaderboard () {
m_Leaderboard = Social.Active.CreateLeaderboard();
m_Leaderboard.id = leaderboardID;
m_Leaderboard.LoadScores(result => DidLoadLeaderboard(result));
}
void DidLoadLeaderboard (bool result) {
Debug.Log("Received " + m_Leaderboard.scores.Length + " scores");
foreach (IScore score in m_Leaderboard.scores) {
Debug.Log(score);
}
but
void Update () {
#if UNITY_IPHONE
if(gameOver == true) {
// REPORT THE PLAYER'S SCORE WHEN THE GAME IS OVER USE A GUI BUTTON TO FLIP THE BOOLEAN FROM FALSE TO TRUE SO THIS GETS CALLED
ReportScore(highScoreInt, leaderboardID);
gameOver = false;
}
#endif
}
void ReportScore (long score, string leaderboardID) {
Debug.Log ("Reporting score " + score + " on leaderboard " + leaderboardID);
Social.ReportScore (score, leaderboardID, success => {
Debug.Log(success ? "Reported score to leaderboard successfully" : "Failed to report score");
});
}
gives an error: "Leaderboard not found." Does anybody know what can cause an error in Social.ReportScore?
Comment
Answer by CartwheelGalaxyInc · Feb 01, 2019 at 10:26 PM
did you managed to fix it? I have the same problem and I don't know what's wrong, thank you @Ted24