I cannot establish a connection between two players using auto-match and GKMatchmakerViewController.
The behavior is this:
-
didFindMatch is called
-
expectedPlayerCount is not zero (always 1)
-
didChangeState is never called
-
after an extended period of time the player disconnected is received.
Does anyone have a solution to this problem?
Thanks!
In order to get the correct number of players connected, make sure you setup your
GKMatchRequestproperly.In this example, I have a game that only works if there are two players connected, so I set the min & max players count to 2:
Then, everything you noted works as expected.
EDIT:
After reading your question again, also make sure you have retained the
GKMatchobject given to you by:-(void) matchmakerViewController:(GKMatchmakerViewController*)viewController didFindMatch:(GKMatch*)match;And of course, you have to set the delegate of this match object: