Instance Property

inviteHandler

A block to be called when an invitation to join a match is accepted by the local player.

Declaration

@property(nonatomic, copy, nonnull) void (^inviteHandler)(GKInvite *acceptedInvite, NSArray *playerIDsToInvite);

Discussion

The block takes the following parameters:

acceptedInvite

The invitation accepted by the player.

playerIDsToInvite

An array of NSString objects containing player identifiers for additional players to invite into the game.

Your block should respond to the invitation in one of two ways:

If your game receives an invitation while it is already running, it should transition to multiplayer play. It should clean up any existing content, such as ending the current match the player is playing, and then process the invitation.

See Also

Deprecated Methods and Properties

- cancelInviteToPlayer:

Cancels a pending invitation to another player.

Deprecated
- findPlayersForHostedMatchRequest:withCompletionHandler:

Initiates a request to find players for a hosted match.

Deprecated
- startBrowsingForNearbyPlayersWithReachableHandler:

Enables the matchmaking process to find nearby players through Bluetooth or WiFi (same subnet only).

Deprecated