Search code examples
ioscocoa-touchgame-centergamekitgkturnbasedmatch

Localized GKTurnBasedMatch message


The message property of GKTurnBasedMatch allows changing the text in the push notification that the next participant receives, but how can I localize it? I tried using Localizable.strings but that doesn't work. I know that regular push notification can easily be localized, but since Game Center has full control over these notifications it seems impossible to do this.


Solution

  • I struggled with the same problem a few months back.

    I ended creating a user class with information about which localization the user was preferring, and then let the other player decide language.

    something like:

    • player1: Starts game
    • player1: inform player2 about nickname, preferred lang etc
    • player2: inform player1 about nickname, preferred lang etc.
    • player1: send message to player2 in preferred lang.

    Not really elegant but working.