I'm building an iPhone game that uses Game Center and I'm having a hard time understanding how to start a match game that was started by receiving an invitation to play from a friend. The docs say this...
The acceptedInvite parameter is non-nil when the application receives an invitation directly from another player. In this situation, the other player’s application has already created the match request, so this copy of your application does not need to create one.
According to this, I don't need to create a match request since the player who did the inviting already created one. If so, how do I obtain the GKMatch object needed to send/receive data to/from the other player? The only way that I know to get the GKMatch object is to create a match request and call the findMatchForRequest
method, which the docs are saying I shouldn't do.
The only code example they have for this involves creating and using the GKMatchmakerViewController
, which I can't use since I'm creating my own custom views.
Thanks so much for your wisdom!
I received a response from one of the Apple engineers on this, here's what he said...
You can do auto-matching with custom views, but there is no way to use invites without using GKMatchmakerViewController. So you should follow the code sample.
I guess there's just going to have to be a radical break in the consistency of my UI.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With