Search code examples
iosswiftgame-centergamekit

Check if App is started with GameCenter challenge


Hello Stackoverflow Community,

I would really like to get help of you, because i am at this problem for around 2 weeks now, and i could not even find something that would help me a bit.

If i get a challenge for my app and click on it, my app will open. Is there a way to get the information on what challenge i clicked and let me display e.g. the score that i have to beat inside my game?

I tried getting the Arguments that the app is started with, but there is nothing that looks like challenge related data in there.

I already managed to get all the challenges for my game, but there is now way i can tell which one i clicked on with that method.

Thanks for you help.


Solution

  • As of this writing, when you click the notification or open the game via the game center, no useful information is passed to your game.

    All I have found are hacky solutions, like putting descriptive text (maybe the requestor's name) in the invite text and then showing that same text when displaying the list of available matches.