At the end of the level I am trying to post the score, then retrieve the top 10 scores via:
if (CoreXT.IsDevice)
{
GameKitXT.ReportScore(leaderboardID, Convert.ToInt64(myGUI.text)); //GameKit Reporting
RetrieveTopTenScores();
}
I have confirmed that the leaderboardID is correct on iTunes. (I am using the leaderboard ID from iTunes, not the reference name).
I have ensured that GameCentre is turned on for the app.
In the app I can see local.auth happening correctly and I get a “Welcome Back XXX, Sandbox” Message.
I have tried replacing the Convert.ToInt64(myGUI.text) with the int score variable.
Once I look on Ios7 game centre there are no scores associated with the leaderboard.
The RetrieveTopTenScores is also not working as there are no scores to retrieve.
Hi FfZ, can you subscribe to GameKitXT.ScoreReported and ScoreReportedFailed events and print out e.description on error?
You should also call RetrieveTopTenScores() after ReportScore() is completed. ReportScore() is an async method, and dispatches one of the above two events when completed.
Also, the Game Center app may not show your sandbox games. You can however, show it within your game by calling GameKitXT.ShowLeaderboard(leaderboardID).
Thank you for the prompt response It appears as if the score is being reported , but there is nothing on game centre (sandbox ?)
Debug:
"Local Player authenticated G:1920xxxxxxx (numeric)
“Local player has no photo or error loading photo”
“Loaded friends”
“Reported Score”
“Error retrieving scores: The requested operations could not be completed because one or more of the parameters are invalid”
– End of Debug –
void RetrieveTopTenScores() {
GKLeaderboard leaderboardRequest = new GKLeaderboard();
if (leaderboardRequest != null) {
// configure request
leaderboardRequest.playerScope = GKLeaderboardPlayerScope.Global;
leaderboardRequest.timeScope = GKLeaderboardTimeScope.AllTime;
leaderboardRequest.category = leaderboardID;
leaderboardRequest.range = new NSRange(1, 10);
// load scores; it calls delegate back when done
leaderboardRequest.LoadScores(delegate(object[] scores, NSError error) {
if (error != null) {
Log("Error retrieving scores: " + error.LocalizedDescription());
} else if (scores != null) {
// got the scores, but the low-level GKScore only has player ID.
// if you want player display name, you need to combine it with
// the high-level API to load the players
string[] playerIDs = scores.Cast<GKScore>().Select(x => x.playerID).ToArray();
Player.LoadPlayersByIDs(playerIDs, delegate(Player[] players) {
// print localized title of leaderboard
//Log("Top 10 for " + leaderboardRequest.title);
for (int i=0; i<scores.Length; i++) {
GKScore score = scores *as GKScore;*