An object that provides information about a player on Game Center.
- iOS 4.1+
- macOS 10.8+
- tvOS 4.1+
- watchOS 3.0+
Every player account on Game Center is permanently assigned a unique player identifier string. Your game should use this string to store per-player information or to disambiguate between players. In most cases, Game Kit classes return player identifier strings to your game. For example, in a multiplayer match, the
playerIDs property contains an array of the player identifiers for all the players connected to the match.
To load information about a set of players, your game calls the
loadPlayers(forIdentifiers:withCompletionHandler:) method, passing in an array of identifier strings. Your completion handler is called after the player data is downloaded from Game Center. For performance and resource reasons, player objects returned by the
loadPlayers(forIdentifiers:withCompletionHandler:) method do not include player photos. To load the photo associated with a player, call the player object’s
The concept of guest players is introduced in iOS 9. Guest players are treated exactly like authenticated players for Game Center multiplayer purposes. However, guest players cannot earn achievements, post to leaderboards, or participate in challenges. Create a guest player with the