GKInviteEventListener Protocol Reference

Framework
/System/Library/Frameworks/GameKit.framework
Availability
Available in iOS 7.0 and later.
Companion guide
Declared in
GKMatchmaker.h

Overview

Handles invite invite events form Game Center. You can invite other players and start your game from directly from Game Center. Accepting an invitation begins the game from Game Center with the accepting player assigned a spot in the game.

Do not implement GKInviteEventListener directly, instead use GKLocalPlayerListener. The GKLocalPlayerListener protocol inherits methods from GKInviteEventListener, GKChallengeListener, and GKTurnBasedEventListener in order to handle multiple events.

Tasks

Starting a New Match

Instance Methods

player:didAcceptInvite:

Called when another player accepts a match invite from the local player. (required)

- (void)player:(GKPlayer *)player didAcceptInvite:(GKInvite *)invite
Parameters
player

The player identifier associated with the invitation.

invite

The invitation accepted by the player.

Availability
  • Available in iOS 7.0 and later.
Declared In
GKMatchmaker.h

player:didRequestMatchWithPlayers:

Called when the local player starts a match with another player from Game Center. (required)

- (void)player:(GKPlayer *)player didRequestMatchWithPlayers:(NSArray *)playerIDsToInvite
Parameters
player

The player identifier associated with the invitation.

playerIDsToInvite

An array of NSString objects containing the player identifiers invited to the match.

Discussion

When this method is called, the game is launched from Game Center and starts the matchmaking process.

Availability
  • Available in iOS 7.0 and later.
Declared In
GKMatchmaker.h