<!--
{
  "availability" : [
    "iOS: 12.4.0 -",
    "iPadOS: 12.4.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.14.6 -",
    "tvOS: 12.4.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "GameKit",
  "identifier" : "/documentation/GameKit/GKPlayer/gamePlayerID",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "GameKit"
    ],
    "preciseIdentifier" : "c:objc(cs)GKPlayer(py)gamePlayerID"
  },
  "title" : "gamePlayerID"
}
-->

# gamePlayerID

A unique identifier for a player of the game.

```
var gamePlayerID: String { get }
```

## Discussion

This identifier is unique to this game instance if the [`scopedIDsArePersistent()`](/documentation/GameKit/GKPlayer/scopedIDsArePersistent()) method returns <doc://com.apple.documentation/documentation/Swift/false>. Otherwise, this identifier is the same across all game instances. An instance is the time between when the game launches and when the game terminates.

For the local player (a [`GKLocalPlayer`](/documentation/GameKit/GKLocalPlayer) object), this identifier is persistent across all local player instances of the game. If the player is friends with the local player, this identifier is persistent across all local player and friend game instances. To determine whether the player is a friend, use the [`loadFriends(_:)`](/documentation/GameKit/GKLocalPlayer/loadFriends(_:)) method.

To protect the player’s privacy, use the [`gamePlayerID`](/documentation/GameKit/GKPlayer/gamePlayerID) property instead of the [`teamPlayerID`](/documentation/GameKit/GKPlayer/teamPlayerID) property. For more information, see [Protecting the player’s privacy using scoped identifiers](/documentation/GameKit/protecting-the-player-s-privacy-using-scoped-identifiers).

If you transfer your game to another developer, the [`gamePlayerID`](/documentation/GameKit/GKPlayer/gamePlayerID) property is the same for the new developer. For more information, see [Overview of app transfer](https://developer.apple.com/help/app-store-connect/transfer-an-app/overview-of-app-transfer).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)