iOS Game Center GKScore playerID

238 views Asked by At

I'm trying to save some GKScores which may have different playerIDs

ex: I have 2 GKScore objects, score1 and score2.

score1 has .playerID = @"player1", .value = 10
score2 has .playerID = @"player2", .value = 12

Does the score gets reported to their respective playeIDs, even when @"player1" is the one signed in while submitting score2 (having playerID = @"player2")?

1

There are 1 answers

5
Lorenzo Linarducci On

playerID is read-only.

When you initialize a new score object, the playerID property is set to the identifier for the local player. If the score object was returned to your game by loading scores from Game Center, the playerID property identifies the player who recorded that score.

When reporting scores, it uses the local user.