When a user is not currently in the game application, I understand Game Center with push an Invite notification to the user's device asking them if they want to play the game. If they accept the invitation then Game Center will open the application automatically on the user's device.
How can the game application know it was started as a result of an accepted invitation? If this can be determined then I can place the user into the game right away and bypass any option screens, displays menus, etc. which are no longer required.
> I have never been invited into a game center game before so cannot understand what an "invited player" actually sees on their screen.
Again.....download and try (edit - ) Go Game Connect - invite a friend, have them invite you, accept their invitation, decline their invitation. The app is free for the first few games.
1) The didAcceptInvite method would be called on the device of the invited player only
Yes
2) inside the didAcceptInvite method there would be a call to the following method so the invited player can create the "match" (based on the data in the invitation) on their device:
For some reason (I don't recall why) my didAcceptInvite:invite presents this:
GKMatchmakerViewController *mmvc = [[GKMatchmakerViewController alloc] initWithInvite:invite];
then both the inviter and the invitee can respond to calls to
(void)matchmakerViewController:(GKMatchmakerViewController *)viewController didFindMatch:(GKMatch *)match
3) The following method would be called on the device of the player who is sent the invite so they know the invited player accepted (ie: connected) the match invitation:
func match(_ match: GKMatch, player: GKPlayer, didChange state: GKPlayerConnectionState)
My code uses this method only to enable/disable a reconnect button. It reklys on didFindMatch to start the game on both devices.
Why do you need to present a "new GKMatchmakerViewController" to the invited player in the didAcceptInvite method? We do not want the invited player to start selecting friends and setting up a match themselves so I am confused what the view controller provides to the invited player
Unfortunately I do not have access to (edit - )Go Game Connect on two devices right now so I can't answer this question. I would be pleased to invite you if you give me your Game Center ID.