<!--
{
  "availability" : [
    "iOS: 4.1.0 -",
    "iPadOS: 4.1.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.8.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 3.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "GameKit",
  "identifier" : "/documentation/GameKit/GKLocalPlayer",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "GameKit"
    ],
    "preciseIdentifier" : "c:objc(cs)GKLocalPlayer"
  },
  "title" : "GKLocalPlayer"
}
-->

# GKLocalPlayer

The local player who signs in to Game Center on the device running the game.

```
class GKLocalPlayer
```

## Overview

Only one player can sign in to Game Center on a device at a time and that player is the *local player*. Before you can start a game that uses GameKit features, verify that the local player signs in to their Game Center account.

You set the handler of the local player shared instance using the [`authenticateHandler`](/documentation/GameKit/GKLocalPlayer/authenticateHandler) property. Then implement this method to handle the multiple times GameKit invokes it during the sign-in process. If the local player needs to create an account or sign in, GameKit provides a view controller that you present to the local player. If the local player successfully signs in, determine whether they have any account restrictions and adjust your game accordingly. For more information about the initialization of the local player, see [Authenticating a player](/documentation/GameKit/authenticating-a-player).

After the local player signs in, their account data and GameKit features are available. You can display the local player’s nickname and avatar, access their recent players and friends, and load their leaderboards and achievements. You can also register a listener object that GameKit calls when the local player sends or accepts invitations to play with others.

## Topics

### Accessing the Local Player

[`local`](/documentation/GameKit/GKLocalPlayer/local-oaa8)

The shared instance of the local player.

[`local`](/documentation/GameKit/GKLocalPlayer/local-1mzi0)

The shared instance of the local player.

### Authenticating the Local Player

[`authenticateHandler`](/documentation/GameKit/GKLocalPlayer/authenticateHandler)

A handler that GameKit calls while initializing the local player.

[`isAuthenticated`](/documentation/GameKit/GKLocalPlayer/isAuthenticated)

A Boolean value that indicates whether a local player has signed in to Game Center.

[`fetchItems(forIdentityVerificationSignature:)`](/documentation/GameKit/GKLocalPlayer/fetchItems(forIdentityVerificationSignature:))

Generates a signature that you can use to authenticate the local player on your own server.

  <doc://com.apple.documentation/documentation/Foundation/NSNotification/Name-swift.struct/GKPlayerAuthenticationDidChangeNotificationName>

[`GKPlayerAuthenticationDidChangeNotificationName`](/documentation/GameKit/GKPlayerAuthenticationDidChangeNotificationName)

A notification that posts after GameKit initializes the local player.

### Determining Whether the Player Is Underage or Restricted

[`isUnderage`](/documentation/GameKit/GKLocalPlayer/isUnderage)

A Boolean value that indicates whether the local player is underage.

[`isMultiplayerGamingRestricted`](/documentation/GameKit/GKLocalPlayer/isMultiplayerGamingRestricted)

A Boolean value that indicates whether the player can join multiplayer games.

[`isPersonalizedCommunicationRestricted`](/documentation/GameKit/GKLocalPlayer/isPersonalizedCommunicationRestricted)

A Boolean value that indicates whether the player can use personalized communication on the device.

### Accessing Friends and Recents

[`loadFriendsAuthorizationStatus(_:)`](/documentation/GameKit/GKLocalPlayer/loadFriendsAuthorizationStatus(_:))

Returns whether the player authorizes your game to access their friends list.

[`GKFriendsAuthorizationStatus`](/documentation/GameKit/GKFriendsAuthorizationStatus)

Constants that indicate if the local player grants access to their friends list.

[`loadFriends(_:)`](/documentation/GameKit/GKLocalPlayer/loadFriends(_:))

Loads the local player’s friends list if the local player and their friends grant access.

[`loadFriends(identifiedBy:completionHandler:)`](/documentation/GameKit/GKLocalPlayer/loadFriends(identifiedBy:completionHandler:))

Loads the player’s friends list, scoped by the identifiers, if the player and their friends grant access.

  <doc://com.apple.documentation/documentation/BundleResources/Information-Property-List/NSGKFriendListUsageDescription>

[`loadChallengableFriends(completionHandler:)`](/documentation/GameKit/GKLocalPlayer/loadChallengableFriends(completionHandler:))

Loads players to whom the local player can issue a challenge.

[`loadRecentPlayers(completionHandler:)`](/documentation/GameKit/GKLocalPlayer/loadRecentPlayers(completionHandler:))

Loads players from the friends list or players that recently participated in a game with the local player.

### Adding Friends

[`isPresentingFriendRequestViewController`](/documentation/GameKit/GKLocalPlayer/isPresentingFriendRequestViewController)

A Boolean value that indicates whether your game presents the friends request view controller.

[`presentFriendRequestCreator(from:)`](/documentation/GameKit/GKLocalPlayer/presentFriendRequestCreator(from:)-7j1kn)

Presents a view controller with a Messages sheet for the player to request friends.

[`presentFriendRequestCreator(from:)`](/documentation/GameKit/GKLocalPlayer/presentFriendRequestCreator(from:)-7clh6)

Opens the Messages app with a sheet for the player to request friends.

### Working with Leaderboards

[`loadDefaultLeaderboardIdentifier(completionHandler:)`](/documentation/GameKit/GKLocalPlayer/loadDefaultLeaderboardIdentifier(completionHandler:))

Loads the identifier for the local player’s default leaderboard.

[`setDefaultLeaderboardIdentifier(_:completionHandler:)`](/documentation/GameKit/GKLocalPlayer/setDefaultLeaderboardIdentifier(_:completionHandler:))

Sets the local player’s default leaderboard.

### Registering Listeners

[`register(_:)`](/documentation/GameKit/GKLocalPlayer/register(_:))

Registers a listener for a particular event.

[`unregisterAllListeners()`](/documentation/GameKit/GKLocalPlayer/unregisterAllListeners())

Unregisters all listeners in your game.

[`unregisterListener(_:)`](/documentation/GameKit/GKLocalPlayer/unregisterListener(_:))

Unregisters a listener object.

### Saving Game Data

[Saving the player’s game data to an iCloud account](/documentation/GameKit/saving-the-player-s-game-data-to-an-icloud-account)

Save game data during play or after a game in the player’s iCloud account that’s accessible from any device.

[`saveGameData(_:withName:completionHandler:)`](/documentation/GameKit/GKLocalPlayer/saveGameData(_:withName:completionHandler:))

Saves game data with the specified name.

[`fetchSavedGames(completionHandler:)`](/documentation/GameKit/GKLocalPlayer/fetchSavedGames(completionHandler:))

Retrieves all available saved games.

[`resolveConflictingSavedGames(_:with:completionHandler:)`](/documentation/GameKit/GKLocalPlayer/resolveConflictingSavedGames(_:with:completionHandler:))

Replaces duplicate saved games that use the same filename with one file containing the specified game data.

[`deleteSavedGames(withName:completionHandler:)`](/documentation/GameKit/GKLocalPlayer/deleteSavedGames(withName:completionHandler:))

Deletes saved games with the specified filename.

[`GKSavedGame`](/documentation/GameKit/GKSavedGame)

An object that represents a file containing saved game data.

[`GKSavedGameListener`](/documentation/GameKit/GKSavedGameListener)

A protocol that handles events related to saving game data.

### Deprecated

[Deprecated symbols](/documentation/GameKit/gklocalplayer-deprecated-symbols)

Review unsupported symbols and their replacements.



---

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)