- Home /
When will Social.ReportScore() fail?
I've got a sandbox leaderboard set up and I thought I'd implement some basic score caching in case the iPhone didn't have connection (you know, on a plane, in a subway, in someone's faraday cage rec room, whatever). The plan was to run Social.ReportScore, check the callback result and if false, cache the score to PlayerPrefs or whatever for the next time the system successfully authenticated.
However... testing it in Airplane mode, the ReportScore result returns true even though GameCenter doesn't get the update (my guess is that it would return false if I had a malformed leaderboard identifier). And when I run the game again with the wifi back on, the scoreboards aren't updated.
So... it appears that Social.ReportScore call is returning true as long as the GameCenter API accepts the call from Unity... but seems unaware of the results beyond that. Is anyone else seeing something similar?
The code is pretty vanilla but for reference, here's what I am doing:
public static void SubmitScore(int score)
{
Social.ReportScore(score,"leaderboard", SuccessCheck);
}
static void SuccessCheck(bool result)
{
if(result)
{
Debug.Log("score submission successful");
}
else
{
Debug.Log("score submission failed");
}
}
I'm getting a "score submission successful" debug log every time when I do this in Airplane mode.
The basic GameCenter API clearly works in offline mode (you can authenticate in as a user, for example-- at least in the Sandbox), so checking the Authenticated status of Social.localUser won't help either...
I gave up myself, but with follow up reading, it seems that more than one device must be testing the app, and all the devices must be friends. Here are a couple of links relating to the above :
Here's what I found.
Social.ReportScore() works just fine. The issue is that Game Center doesn't appear to show leaderboard content for the localUser if the localUser is the only player with an entry in the leaderboard.
If you test with Player1, set a score, and view the leaderboard, you won't see Player1. But if you then test with Player2, and view the leaderboard, you'll see Player1 but not Player2. If you then set a score with Player2, and view the leaderboard again, you'll see both Player1 and Player2.
(from : http://forum.unity3d.com/threads/116901-Game-Center-Support/page4 )
http://answers.unity3d.com/questions/234471/game-center-reportscore-leaderboard.html
http://answers.unity3d.com/questions/252862/no-score-on-game-center-leaderboard.html
Good Luck =]
Your answer
Follow this Question
Related Questions
Did Social.LoadUsers() stop working? 3 Answers
'Social.Showleaderboardsui()' keeps showing the achievements page in iOS? 1 Answer
Wrong values for ILeaderboard.maxRange 2 Answers
Unity Social API for IOS 0 Answers
iOS Game Center displays "No Challenges" Instead of Achievements/Leaderboards 3 Answers