This may be a silly question, but “Are you storing their highscore in game center first?” i.e. Are you tracking score locally and later submitting it to game center?
When handling the results of a “loadScores” call, event.data in the callback listener is an array of items (tables), each of which contains the following properties:
event.data[1].playerID – ID of the first player in the request
event.data[3].rank – Rank of the third player in the request
In addition, the event.localPlayerScore table is accessible for the logged-in player. This contains all of the properties shown above.
event.localPlayerScore.playerID
event.localPlayerScore.rank
So, if the player is logged in, you can get their score value by “event.localPlayerScore.value”. Otherwise you need to use event.data as also described above.
I’m storing a highscore in gamecenter when there is a new highscore. And in case someone is deinstalling his game and then want to install it again I need access to his gamecenter highscore data to restore his previous highscore in the new install.
I did some more tests and it seems the local user is not logged in, so I can not get the correct data BUT I don’t understand why this is happening, because I get the welcome info on top of the phone which shows I’m looged into gamecenter correctly. I can call the leaderboard and am listed as “friend” with my top score in the leaderboard list. But when trying to get the info for my logged in user it fails.
This may be a silly question, but “Are you storing their highscore in game center first?” i.e. Are you tracking score locally and later submitting it to game center?
When handling the results of a “loadScores” call, event.data in the callback listener is an array of items (tables), each of which contains the following properties:
event.data[1].playerID – ID of the first player in the request
event.data[3].rank – Rank of the third player in the request
In addition, the event.localPlayerScore table is accessible for the logged-in player. This contains all of the properties shown above.
event.localPlayerScore.playerID
event.localPlayerScore.rank
So, if the player is logged in, you can get their score value by “event.localPlayerScore.value”. Otherwise you need to use event.data as also described above.
I’m storing a highscore in gamecenter when there is a new highscore. And in case someone is deinstalling his game and then want to install it again I need access to his gamecenter highscore data to restore his previous highscore in the new install.
I did some more tests and it seems the local user is not logged in, so I can not get the correct data BUT I don’t understand why this is happening, because I get the welcome info on top of the phone which shows I’m looged into gamecenter correctly. I can call the leaderboard and am listed as “friend” with my top score in the leaderboard list. But when trying to get the info for my logged in user it fails.