Search code examples
iosobjective-ccocoagame-centergamekit

Missing Invitations in Game Center Sandbox


I'm experiencing the strangest behavior with Game Center.

I'm setting up turn-based matches with GKTurnBasedMatch and friends. Authentication of the local player works perfectly. Using the GKTurnBasedMatch class method loadMatchesWithCompletionHandler: seems to sensibly return GKTurnBasedMatch objects. To initiate new matches and invites to Game Center friends, I use the standard GKTurnBasedMatchmakerViewController.

When I create matches with GKTurnBasedMatchmakerViewController, they show up there when the showExistingMatches property is YES, for the game creator.

However, if I invite another player using GKTurnBasedMatchmakerViewController, the receiving player never receives an invite. No Game Center push notification, and no (except once or twice, and sporadically) game with an "Invited" heading in the GKTurnBasedMatchmakerViewController.

Strangely enough, that player WILL receive a "Game Over" Game Center notification if the initiating user then ends the game they created with an invite.

Using loadMatchesWithCompletionHandler:, the returned matches make sense for the inviting player (correct playerID values in the participants, correct GKTurnBasedParticipantStatus on the participants), but nothing shows up at all for the invited player.

I'm using two separate devices, both are definitely logged into the Sandbox mode of Game Center, and everything is set up in iTunes Connect, etc. Both Game Center accounts are set to accept invites.

Anyone ever seen anything like this?


Solution

  • Possible solution: when the inviter made their first move, and the message endTurnWithNextParticipants:turnTimeout:matchData:completionHandler: was sent, I wasn't sending the proper participants in the first argument, and so the turn was never set to be the invitee's.