Changing the text in a GKTurnBasedMatch's 'your turn' and 'game over' notifications?

Go To


I'm implementing a turn based multiplayer game using GameKit and GKTurnBasedMatch. When the game is over, players receive a 'game over' notification; when it is a player's turn, they receive a 'your turn' notification. These notifications occur automatically by using GKTurnBasedMatch.

Is it possible to change the text or icon displayed by these notifications?

2012-04-03 22:11
by Nortiest


Yes, you can change the text by setting the message property before calling the any of the functions that end the turn:

To set a custom message:

myTurnBasedMatch.message = @"It's now your turn!"

To let Game Center choose the message:

myTurnBasedMatch.message = @"" // or = nil

Once you start setting the message yourself, you need to set it every time (otherwise the previous message will be used, even for different circumstances, like someone wins the match).

2012-04-04 15:53
by jonsibley