Search code examples
iosswiftsprite-kitgame-center

Testing Game Center Achievements


I'm at a point where I'm ready to start adding game center achievements into my app. I've registered the app in itunes connect, and set up a test achievement, which shows up in my pre-release app on my phone.

My question is how can I test if the achievement will work since they took away sandboxes? From what I understand, sandboxes were supposed to mimic the production servers for game center so you could test them out before releasing the app. I found a technical note saying that now you use the pre-release version to test it, so maybe I just go ahead a set an achievement progress like normal? Is there a way to reset an achievement so I can test it multiple times or is it a one-time thing? I haven't tried sending any data the to game center servers yet for fear of messing something up - any help/insights would be appreciated.

Update: I poked around iTunes Connect and found a 'delete test data' for the leaderboards, but I don't see anything similar to that for achievements.


Solution

  • I found out that there's a method you can call in the GKAchievement class called resetAchievementsWithCompletionHandler that clears them from game center. I haven't been able to test it yet, but this looks like what I need.

    Also, from what I've read it seems like the pre-release game center is basically the new sandbox. I don't think achievements unlocked in a pre-release game interact with the production game center servers.