<!--
{
  "availability" : [
    "iOS: 5.0.0 - 8.0.0",
    "iPadOS: 5.0.0 - 8.0.0",
    "macCatalyst: 13.1.0 - 13.1.0",
    "macOS: 10.8.0 - 10.10.0",
    "visionOS: 1.0.0 - 1.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "GameKit",
  "identifier" : "/documentation/GameKit/GKMatchmakerViewControllerDelegate/matchmakerViewController(_:didReceiveAcceptFromHostedPlayer:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "GameKit"
    ],
    "preciseIdentifier" : "c:objc(pl)GKMatchmakerViewControllerDelegate(im)matchmakerViewController:didReceiveAcceptFromHostedPlayer:"
  },
  "title" : "matchmakerViewController(_:didReceiveAcceptFromHostedPlayer:)"
}
-->

# matchmakerViewController(_:didReceiveAcceptFromHostedPlayer:)

Called when a player in a hosted match accepts the invitation.

```
optional func matchmakerViewController(_ viewController: GKMatchmakerViewController, didReceiveAcceptFromHostedPlayer playerID: String)
```

## Parameters

`viewController`

The view controller that accepted the invitation.

`playerID`

The identifier of the accepting player.

## Discussion

After a player accepts an invitation, that player’s device should connect to your server. Once the connection is established, your game should call the view controller’s [`setHostedPlayer(_:connected:)`](/documentation/GameKit/GKMatchmakerViewController/setHostedPlayer(_:connected:)) method to update the player’s connection status.

---

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)