GKTurnBasedEventHandler

The GKTurnedBasedEventHandler is a delegate protocol that is responsible for handling important messages related to turn-based games. To set a delegate for events, use the following code.

    [[GKTurnBasedEventHandler sharedTurnBasedEventHandler] setDelegate: self];

The protocol has three optional methods.

  • handleInviteFromGameCenter: When your delegate receives this method, it should populate a new GKMatchRequest with the playersToInvite that are passed in through the method. You then need to begin a new match or present the matchmaker GUI. This method is called when the user accepts a match invite from a friend.
  • handleTurnEventForMatch: Your delegate receives this message when the user has accepted a push notification ...

Get Beginning iOS Game Center and Game Kit: For iPhone, iPad, and iPod touch now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.