<!--
{
  "availability" : [
    "iOS: 4.1.0 - 6.0.0",
    "iPadOS: 4.1.0 - 6.0.0",
    "visionOS: 1.0.0 - 1.0.0",
    "watchOS: 2.0.0 - 2.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "GameKit",
  "identifier" : "/documentation/GameKit/GKLocalPlayer/authenticate(completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "GameKit"
    ],
    "preciseIdentifier" : "c:objc(cs)GKLocalPlayer(im)authenticateWithCompletionHandler:"
  },
  "title" : "authenticate(completionHandler:)"
}
-->

# authenticate(completionHandler:)

Initializes the local player on the device.

```
func authenticate(completionHandler: (@Sendable ((any Error)?) -> Void)? = nil)
```

## Parameters

`completionHandler`

A block to call when the player initializes or when an error occurs.

    The block takes the following parameter:

- error: This parameter is `nil` if the player successfully initializes. Otherwise, it contains an error object that describes the error that occurrs.

## Discussion

For more information, see [Authenticating a player](/documentation/GameKit/authenticating-a-player).

---

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)