Search code examples
iphonecocos2d-iphonegame-centerachievements

Game center achievements in Cocos2d


In my app i'm able to add game center achievements successfully. But i'm not able to reset those achievements. I tried the methods described in the Apple's Game kit tutorial, but still i can't reset once added achievements in the game center.


Solution

  • What have you tried from the Apple's GameKit Tutorials?

    This should work regardless of what you use (UIKit, Cocos2d):

    Find your authenticate method and call the reset achievements method: i.e

    [[GKLocalPlayer localPlayer] authenticateWithCompletionHandler:^(NSError *error) {
    
    
    [GKAchievement resetAchievementsWithCompletionHandler:^(NSError *error) {
                NSLog(@"achievements reset");
            }];
    
    }];
    

    Don't forget to comment the reset method when you're done, or else you'll be reseting the achievements every time you log in to Game Center. Let me know how it goes.