I'm trying to send an exchange to another player in a GKTurnBasedMatch. When I send it, my completion handler gets a big error message, with these descriptions:
The requested operation could not be completed because the session is in an invalid state.
Game is not active, session state is Matching
I want the match to start when there are just two players, but to allow a total of 16 players. So naturally I'm setting maxPlayers = 16
and minPlayers = 2
. I'd thought that would automatically start the match once two players were seated, but it's not so.
I've tried to do this once the match has two players, :
if match.participants?.count == 2 {
match.status = GKTurnBasedMatchStatus.open
}
But then I'm told that status
is read-only. I can't manually set it.
Now, with a regular GKMatch
, I officially start the match by calling:
GKMatchmaker.shared().finishMatchmaking(for: match)
But there doesn't seem to be a similar thingy for GKTurnBasedMatch
.
How do I actually get the match started, so I can send an exchange between the two players?