---
title: "handleInvite(fromGameCenter:)"
framework: gamekit
role: symbol
role_heading: Instance Method
path: "gamekit/gkturnbasedeventhandlerdelegate/handleinvite(fromgamecenter:)"
---

# handleInvite(fromGameCenter:)

Sent to the delegate when the local player receives an invitation to join a new turn-based match.

## Declaration

```swift
func handleInvite(fromGameCenter playersToInvite: [String])
```

## Parameters

- `playersToInvite`: An array of NSString objects containing the player identifiers for the players to initially invite to the game.

## Discussion

Discussion When your delegate receives this message, your game should create a new GKMatchRequest object and assign the playersToInvite parameter to the match request’s playersToInvite property. Then, your game can either call the GKTurnBasedMatch class method find(for:withCompletionHandler:) to find a match programmatically or it can use the request to instantiate a new GKTurnBasedMatchmakerViewController object to show a user interface to the player.

## See Also

### Receiving Turn-based Events

- [handleTurnEvent(for:)](gamekit/gkturnbasedeventhandlerdelegate/handleturnevent(for:).md)
- [handleTurnEvent(for:didBecomeActive:)](gamekit/gkturnbasedeventhandlerdelegate/handleturnevent(for:didbecomeactive:).md)
- [handleMatchEnded(_:)](gamekit/gkturnbasedeventhandlerdelegate/handlematchended(_:).md)
