<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>cocos2d for iPhone &#187; Tag: achievements - Recent Posts</title>
		<link>http://www.cocos2d-iphone.org/forum/tags/achievements</link>
		<description>A fast, easy to use, free, and community supported 2D game engine</description>
		<language>en-US</language>
		<pubDate>Fri, 10 Feb 2012 03:53:40 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://www.cocos2d-iphone.org/forum/search.php</link>
		</textInput>
		<atom:link href="http://www.cocos2d-iphone.org/forum/rss/tags/achievements" rel="self" type="application/rss+xml" />

		<item>
			<title>efish on "GKHelper shows Leaderboards but not Achievements view"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/22824#post-141166</link>
			<pubDate>Wed, 25 Jan 2012 15:37:50 +0000</pubDate>
			<dc:creator>efish</dc:creator>
			<guid isPermaLink="false">141166@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>You are very nice. But how about the GameKitHelper.h?
</p></description>
		</item>
		<item>
			<title>oisincar on "5 Game Center general questions"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28470#post-140228</link>
			<pubDate>Thu, 19 Jan 2012 16:20:01 +0000</pubDate>
			<dc:creator>oisincar</dc:creator>
			<guid isPermaLink="false">140228@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>ahh yes, i see what you mean... but on the other hand, what if i forgot my game center account password,  and had to create a new one.<br />
Is it right for me to have to start again? Also, if the user is not conected to the internet, (and so not logged in) is it fair that none of their game play is logged?</p>
<p>the solution that most games seem to use, is by creating different profiles for different users in the game, and allowing users to reset the game data.<br />
Anyway, if someone wanted to cheat, it isn't too difficult, just look at all the players in GC who can complete a lvl in 0.000001s...</p>
<p>glad i could help!<br />
Oisin
</p></description>
		</item>
		<item>
			<title>wilczarz on "5 Game Center general questions"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28470#post-140212</link>
			<pubDate>Thu, 19 Jan 2012 14:39:23 +0000</pubDate>
			<dc:creator>wilczarz</dc:creator>
			<guid isPermaLink="false">140212@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hey @<a href='http://www.cocos2d-iphone.org/forum/profile/62482'>oisincar</a>, thanks for response!<br />
1) Fair enough :)<br />
2&#38;3) I thought achievement points can participate in score. Now I see my optional "stars" should be part of the score. And that achievements are bullshit :)<br />
4) Ok super clear.<br />
5) So look: I score 100 points, and that goes to my GC account. Then someone takes my ipad, logs in with his credentials, scores 1 point, and has 1001 points in GC. Seems unfair doesn't it?</p>
<p>Separate lederboard for game time is a good idea.</p>
<p>EDIT: @<a href='http://www.cocos2d-iphone.org/forum/profile/559'>cybergreg</a>, thanks also :)
</p></description>
		</item>
		<item>
			<title>cybergreg on "5 Game Center general questions"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28470#post-140211</link>
			<pubDate>Thu, 19 Jan 2012 14:29:17 +0000</pubDate>
			<dc:creator>cybergreg</dc:creator>
			<guid isPermaLink="false">140211@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Re: GC<br />
1) I have levels organized in level packs. Is it a good idea to have one leaderboard per pack, or rather one global leaderboard with total score?<br />
Remember the GC limit is 25 leaderboards, make it so you can expand your app, so don't start with 24 ;-)<br />
2) My "score" will be the number of levels completed. Should I care that many people can have the same score? Can you think of a reasonable formula to respect total game time?<br />
I have an achievements leaderboard so many players are the same however think of a way to provide an actual "score" for each level<br />
3) Achievements have "points". Are these respected in any way when calculating, um, anything?<br />
Yes, you can't exceed 1000 and you can view payers in GC by total points<br />
4) Player is not always authenticated in GC. When should scores &#38; achievements be submitted? After authentication (all leaderboards/achievments) or on level completition (only current leaderb/ achv) ?<br />
Use some sort of GC manager that will submit but cache on errors, or just target iOS 5 and submit<br />
5) I store game progress in a plist. Should I store separate score for every GC user?<br />
I don't but my game is not the kind you pass around and share, your might be. I encrypt my data and have had no problems with bogus scores.
</p></description>
		</item>
		<item>
			<title>oisincar on "5 Game Center general questions"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28470#post-140200</link>
			<pubDate>Thu, 19 Jan 2012 13:32:44 +0000</pubDate>
			<dc:creator>oisincar</dc:creator>
			<guid isPermaLink="false">140200@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>i dont know a whole lot about this, BE WARNED!!</p>
<p>1) that depends how many levels per pack you have, but genraly, the whole point of deviding your levels into separate packs, is thet they are seprate...</p>
<p>2)i would definitely advise you not to count the score this way, since it would be fairly fair to assume that everyone who has bought your game is going to finish it,<br />
though that depends on how many levels you've got.<br />
Normaly I like to play through a game completly first, and then go back and try to get as high a score as i can on each level.</p>
<p>perhaps you could have a leaderboard for "time spent playing" or "lowest combined time for each lvl."<br />
separate from your main leaderboard?</p>
<p>3) i dont think so... i know i don't think much of them when playing...<br />
i think that in a persons GC profile, you are supposed to be able to judge how much of a gaming nerd they are by the number of achievement points they have.</p>
<p>4) i am not too sure what you mean here? if, when a lvl is completed, and the score cannot be submitted, store that in NSUserDefaults... and on authentication, check for any, and submit them again.</p>
<p>5) whaa? sorry, i really have no idea...</p>
<p>hope that helps in some way...<br />
Oisin
</p></description>
		</item>
		<item>
			<title>wilczarz on "5 Game Center general questions"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28470#post-140133</link>
			<pubDate>Wed, 18 Jan 2012 23:57:25 +0000</pubDate>
			<dc:creator>wilczarz</dc:creator>
			<guid isPermaLink="false">140133@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi guys, I am starting with GC and I need some advice:<br />
1) I have levels organized in level packs. Is it a good idea to have one leaderboard per pack, or rather one global leaderboard with total score?<br />
2) My "score" will be the number of levels completed. Should I care that many people can have the same score? Can you think of a reasonable formula to respect total game time?<br />
3) Achievements have "points". Are these respected in any way when calculating, um, anything?<br />
4) Player is not always authenticated in GC. When should scores &#38; achievements be submitted? After authentication (all leaderboards/achievments) or on level completition (only current leaderb/ achv) ?<br />
5) I store game progress in a plist. Should I store separate score for every GC user? </p>
<p>Sorry for the long list but I haven't found Apple docs particularly helpful with these questions. Thanks for any help!
</p></description>
		</item>
		<item>
			<title>phil_me_up on "OpenFeint achievements"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/23784#post-128560</link>
			<pubDate>Thu, 24 Nov 2011 16:02:06 +0000</pubDate>
			<dc:creator>phil_me_up</dc:creator>
			<guid isPermaLink="false">128560@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>You might want to check your OF delegate to make sure that you're not blocking the default notifications. Here's an extract from mine.</p>
<pre><code>-(BOOL)isOpenFeintNotificationAllowed:(OFNotificationData*)notificationData
{
	if(notificationData.notificationCategory == kNotificationCategoryAchievement
	   &#124;&#124; notificationData.notificationCategory == kNotificationCategoryLogin
	   &#124;&#124; notificationData.notificationCategory == kNotificationCategoryHighScore)
	{
		CCLOG(@&#34;Block Notification&#34;);
		return NO;
	}
	else
	{
		CCLOG(@&#34;Allow Notification&#34;);
		return YES;
	}

}</code></pre>
<p>That blocks the highscore, achievement and login notifications (so I can handle them separately to avoid performance issues) and allows the others. </p>
<p>The below then handles the blocked notifications (note that notificationLayer is my own class made to display notifications in a way suitable for my game).</p>
<pre><code>-(void)handleDisallowedNotification:(OFNotificationData*)notificationData
{
	if(notificationData.notificationCategory == kNotificationCategoryAchievement)
	{
		CCLOG(@&#34;handling achivement notification&#34;);
		OFUnlockedAchievementNotificationData *data = (OFUnlockedAchievementNotificationData *)notificationData;
		NotificationLayer* notificationLayer = [NotificationLayer sharedNotificationLayer];
        [notificationLayer showNotification:@&#34;Achievement Unlocked&#34;];
		//[notificationLayer showNotification:[NSString stringWithFormat:@&#34;%d - &#039;%@&#039;&#34;, data.unlockedAchievement.gamerscore, data.unlockedAchievement.title]]; //this is another option to display the the name of the achievement.
	}
}</code></pre>
<p>Warning - I edited some of that down for the post so it should work, but be wary of errors!
</p></description>
		</item>
		<item>
			<title>callispo on "OpenFeint achievements"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/23784#post-128550</link>
			<pubDate>Thu, 24 Nov 2011 15:04:02 +0000</pubDate>
			<dc:creator>callispo</dc:creator>
			<guid isPermaLink="false">128550@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hello there, I've been trying to integrate OpenFeint Achievements in my game for a while now. The achievements are being unlocked, as shown in user's OpenFeint profile but there is no notification bar showing up. I am posting the code below, please tell me what am I doing wrong.</p>
<p>Initialization Code:<br />
---------------</p>
<pre><code>NSDictionary* settings = [NSDictionary dictionaryWithObjectsAndKeys:
							  [NSNumber numberWithInt:UIInterfaceOrientationLandscapeRight],
							  OpenFeintSettingDashboardOrientation,
							  [NSNumber numberWithBool:NO],
							  OpenFeintSettingDisableUserGeneratedContent,
#ifdef DEBUG
							  [NSNumber numberWithInt:OFDevelopmentMode_DEVELOPMENT],
							  OpenFeintSettingDevelopmentMode,
#else
							  [NSNumber numberWithInt:OFDevelopmentMode_RELEASE],
							  OpenFeintSettingDevelopmentMode,
#endif
							  nil];

#ifdef DEBUG
	CCLOG(@&#34;Debug mode set&#34;);
#else
	CCLOG(@&#34;Not-Debug mode&#34;);
#endif

	if ([Globals sharedInstance].ofDelegates == NULL)
	{
		[Globals sharedInstance].ofDelegates = [[CFOFDelegates alloc] init];
		ofNotificationDelegate = [CFOFNotificationDelegate new];

		OFDelegatesContainer* delegates = [OFDelegatesContainer containerWithOpenFeintDelegate:[Globals sharedInstance].ofDelegates];
		delegates.notificationDelegate = ofNotificationDelegate;

		[OpenFeint initializeWithProductKey:@&#34;XXXXX&#34;
								  andSecret:@&#34;XXXXX&#34;
							 andDisplayName:@&#34;XXXXX&#34;
								andSettings:settings // see OpenFeintSettings.h
							   andDelegates:delegates]; // see OFDelegatesContainer.h
	}</code></pre>
<p>Achievement's Unlocking Code:<br />
--------------------------</p>
<p>[[OFAchievement achievement: ACHIEVEMENT_1] unlock];
</p></description>
		</item>
		<item>
			<title>jonn4y on "GKHelper shows Leaderboards but not Achievements view"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/22824#post-126297</link>
			<pubDate>Wed, 16 Nov 2011 08:45:57 +0000</pubDate>
			<dc:creator>jonn4y</dc:creator>
			<guid isPermaLink="false">126297@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi,</p>
<p>i have added GKHelper with no issues and have everything working fine (completing achievements, adding to leader boards, showing leader boards etc)<br />
i have search the forums and stack overflow but can't seem to find this issue,</p>
<p>basically this works showing the leader boards:</p>
<pre><code>GameKitHelper* gkHelper = [GameKitHelper sharedGameKitHelper];
    [gkHelper showLeaderboard];</code></pre>
<p>but this doesn't to show the achievements:</p>
<pre><code>GameKitHelper* gkHelper = [GameKitHelper sharedGameKitHelper];
    [gkHelper showAchievements];</code></pre>
<p>it works perfect in another game i wrote but won't show here, can't be anything in the rootviewcontroller because leader boards are showing right?</p>
<p>anyone have any ideas?</p>
<p>thanks very much</p>
<p>just for fun heres my GKHelper.m:</p>
<pre><code>/*
 * cocos2d-project <a href="http://www.learn-cocos2d.com" rel="nofollow">http://www.learn-cocos2d.com</a>
 *
 * Copyright (c) 2010 Steffen Itterheim
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the &#34;Software&#34;), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED &#34;AS IS&#34;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

#<a href='http://www.cocos2d-iphone.org/forum/tags/import'>import</a> &#34;GameKitHelper.h&#34;

static NSString* kCachedAchievementsFile = @&#34;CachedAchievements.archive&#34;;

@interface GameKitHelper (Private)
-(void) registerForLocalPlayerAuthChange;
-(void) setLastError:(NSError*)error;
-(void) initCachedAchievements;
-(void) cacheAchievement:(GKAchievement*)achievement;
-(void) uncacheAchievement:(GKAchievement*)achievement;
-(void) loadAchievements;
-(void) initMatchInvitationHandler;
-(UIViewController*) getRootViewController;
@end

@implementation GameKitHelper

static GameKitHelper *instanceOfGameKitHelper;

#pragma mark Singleton stuff
+(id) alloc
{
	@synchronized(self)
	{
		NSAssert(instanceOfGameKitHelper == nil, @&#34;Attempted to allocate a second instance of the singleton: GameKitHelper&#34;);
		instanceOfGameKitHelper = [[super alloc] retain];
		return instanceOfGameKitHelper;
	}

	// to avoid compiler warning
	return nil;
}

+(GameKitHelper*) sharedGameKitHelper
{
	@synchronized(self)
	{
		if (instanceOfGameKitHelper == nil)
		{
			[[GameKitHelper alloc] init];
		}

		return instanceOfGameKitHelper;
	}

	// to avoid compiler warning
	return nil;
}

#pragma mark Init &#38; Dealloc

@synthesize delegate;
@synthesize isGameCenterAvailable;
@synthesize lastError;
@synthesize achievements;
@synthesize currentMatch;
@synthesize matchStarted;

-(id) init
{
	if ((self = [super init]))
	{
		// Test for Game Center availability
		Class gameKitLocalPlayerClass = NSClassFromString(@&#34;GKLocalPlayer&#34;);
		bool isLocalPlayerAvailable = (gameKitLocalPlayerClass != nil);

		// Test if device is running iOS 4.1 or higher
		NSString* reqSysVer = @&#34;4.1&#34;;
		NSString* currSysVer = [[UIDevice currentDevice] systemVersion];
		bool isOSVer41 = ([currSysVer compare:reqSysVer options:NSNumericSearch] != NSOrderedAscending);

		isGameCenterAvailable = (isLocalPlayerAvailable &#38;&#38; isOSVer41);
		NSLog(@&#34;GameCenter available = %@&#34;, isGameCenterAvailable ? @&#34;YES&#34; : @&#34;NO&#34;);

		[self registerForLocalPlayerAuthChange];

		[self initCachedAchievements];
	}

	return self;
}

-(void) dealloc
{
	CCLOG(@&#34;dealloc %@&#34;, self);

	[instanceOfGameKitHelper release];
	instanceOfGameKitHelper = nil;

	[lastError release];

	[self saveCachedAchievements];
	[cachedAchievements release];
	[achievements release];

	[currentMatch release];

	[[NSNotificationCenter defaultCenter] removeObserver:self];

	[super dealloc];
}

#pragma mark setLastError

-(void) setLastError:(NSError*)error
{
	[lastError release];
	lastError = [error copy];

	if (lastError)
	{
		NSLog(@&#34;GameKitHelper ERROR: %@&#34;, [[lastError userInfo] description]);
	}
}

#pragma mark Player Authentication

-(void) authenticateLocalPlayer
{
	if (isGameCenterAvailable == NO)
		return;

	GKLocalPlayer* localPlayer = [GKLocalPlayer localPlayer];
	if (localPlayer.authenticated == NO)
	{
		// Authenticate player, using a block object. See Apple&#039;s Block Programming guide for more info about Block Objects:
		// <a href="http://developer.apple.com/library/mac/#" rel="nofollow">http://developer.apple.com/library/mac/#</a><a href='http://www.cocos2d-iphone.org/forum/tags/documentation'>documentation</a>/Cocoa/Conceptual/Blocks/Articles/00_Introduction.html
		[localPlayer authenticateWithCompletionHandler:^(NSError* error)
         {
             [self setLastError:error];

             if (error == nil)
             {
                 [self initMatchInvitationHandler];
                 [self reportCachedAchievements];
                 [self loadAchievements];
             }
         }];

		/*
		 // NOTE: bad example ahead!

		 // If you want to modify a local variable inside a block object, you have to prefix it with the __block keyword.
		 __block bool success = NO;

		 [localPlayer authenticateWithCompletionHandler:^(NSError* error)
		 {
         success = (error == nil);
		 }];

		 // CAUTION: success will always be NO here! The block isn&#039;t run until later, when the authentication call was
		 // confirmed by the Game Center server. Set a breakpoint inside the block to see what is happening in what order.
		 if (success)
         NSLog(@&#34;Local player logged in!&#34;);
		 else
         NSLog(@&#34;Local player NOT logged in!&#34;);
		 */
	}
}

-(void) onLocalPlayerAuthenticationChanged
{
	[delegate onLocalPlayerAuthenticationChanged];
}

-(void) registerForLocalPlayerAuthChange
{
	if (isGameCenterAvailable == NO)
		return;

	// Register to receive notifications when local player authentication status changes
	NSNotificationCenter* nc = [NSNotificationCenter defaultCenter];
	[nc addObserver:self
		   selector:@selector(onLocalPlayerAuthenticationChanged)
			   name:GKPlayerAuthenticationDidChangeNotificationName
			 object:nil];
}

#pragma mark Friends &#38; Player Info

-(void) getLocalPlayerFriends
{
	if (isGameCenterAvailable == NO)
		return;

	GKLocalPlayer* localPlayer = [GKLocalPlayer localPlayer];
	if (localPlayer.authenticated)
	{
		// First, get the list of friends (player IDs)
		[localPlayer loadFriendsWithCompletionHandler:^(NSArray* friends, NSError* error)
         {
             [self setLastError:error];
             [delegate onFriendListReceived:friends];
         }];
	}
}

-(void) getPlayerInfo:(NSArray*)playerList
{
	if (isGameCenterAvailable == NO)
		return;

	// Get detailed information about a list of players
	if ([playerList count] &#62; 0)
	{
		[GKPlayer loadPlayersForIdentifiers:playerList withCompletionHandler:^(NSArray* players, NSError* error)
         {
             [self setLastError:error];
             [delegate onPlayerInfoReceived:players];
         }];
	}
}

#pragma mark Scores &#38; Leaderboard

-(void) submitScore:(int64_t)score category:(NSString*)category
{
	if (isGameCenterAvailable == NO)
		return;

	GKScore* gkScore = [[[GKScore alloc] initWithCategory:category] autorelease];
	gkScore.value = score;

	[gkScore reportScoreWithCompletionHandler:^(NSError* error)
     {
         [self setLastError:error];

         bool success = (error == nil);
         [delegate onScoresSubmitted:success];
     }];
}

-(void) retrieveScoresForPlayers:(NSArray*)players
						category:(NSString*)category
						   range:(NSRange)range
					 playerScope:(GKLeaderboardPlayerScope)playerScope
					   timeScope:(GKLeaderboardTimeScope)timeScope
{
	if (isGameCenterAvailable == NO)
		return;

	GKLeaderboard* leaderboard = nil;
	if ([players count] &#62; 0)
	{
		leaderboard = [[[GKLeaderboard alloc] initWithPlayerIDs:players] autorelease];
	}
	else
	{
		leaderboard = [[[GKLeaderboard alloc] init] autorelease];
		leaderboard.playerScope = playerScope;
	}

	if (leaderboard != nil)
	{
		leaderboard.timeScope = timeScope;
		leaderboard.category = category;
		leaderboard.range = range;
		[leaderboard loadScoresWithCompletionHandler:^(NSArray* scores, NSError* error)
         {
             [self setLastError:error];
             [delegate onScoresReceived:scores];
         }];
	}
}

-(void) retrieveTopTenAllTimeGlobalScores
{
	[self retrieveScoresForPlayers:nil
						  category:nil
							 range:NSMakeRange(1, 10)
					   playerScope:GKLeaderboardPlayerScopeGlobal
						 timeScope:GKLeaderboardTimeScopeAllTime];
}

#pragma mark Achievements

-(void) loadAchievements
{
	if (isGameCenterAvailable == NO)
		return;

	[GKAchievement loadAchievementsWithCompletionHandler:^(NSArray* loadedAchievements, NSError* error)
     {
         [self setLastError:error];

         if (achievements == nil)
         {
             achievements = [[NSMutableDictionary alloc] init];
         }
         else
         {
             [achievements removeAllObjects];
         }

         for (GKAchievement* achievement in loadedAchievements)
         {
             [achievements setObject:achievement forKey:achievement.identifier];
         }

         [delegate onAchievementsLoaded:achievements];
     }];
}

-(GKAchievement*) getAchievementByID:(NSString*)identifier
{
	if (isGameCenterAvailable == NO)
		return nil;

	// Try to get an existing achievement with this identifier
	GKAchievement* achievement = [achievements objectForKey:identifier];

	if (achievement == nil)
	{
		// Create a new achievement object
		achievement = [[[GKAchievement alloc] initWithIdentifier:identifier] autorelease];
		[achievements setObject:achievement forKey:achievement.identifier];
	}

	return [[achievement retain] autorelease];
}

-(void) reportAchievementWithID:(NSString*)identifier percentComplete:(float)percent
{
	if (isGameCenterAvailable == NO)
		return;

	GKAchievement* achievement = [self getAchievementByID:identifier];
	if (achievement != nil &#38;&#38; achievement.percentComplete &#60; percent)
	{
		achievement.percentComplete = percent;
		[achievement reportAchievementWithCompletionHandler:^(NSError* error)
         {
             [self setLastError:error];

             bool success = (error == nil);
             if (success == NO)
             {
                 // Keep achievement to try to submit it later
                 [self cacheAchievement:achievement];
             }

             [delegate onAchievementReported:achievement];
         }];
	}
}

-(void) resetAchievements
{
	if (isGameCenterAvailable == NO)
		return;

	[achievements removeAllObjects];
	[cachedAchievements removeAllObjects];

	[GKAchievement resetAchievementsWithCompletionHandler:^(NSError* error)
     {
         [self setLastError:error];
         bool success = (error == nil);
         [delegate onResetAchievements:success];
     }];
}

-(void) reportCachedAchievements
{
	if (isGameCenterAvailable == NO)
		return;

	if ([cachedAchievements count] == 0)
		return;

	for (GKAchievement* achievement in [cachedAchievements allValues])
	{
		[achievement reportAchievementWithCompletionHandler:^(NSError* error)
         {
             bool success = (error == nil);
             if (success == YES)
             {
                 [self uncacheAchievement:achievement];
             }
         }];
	}
}

-(void) initCachedAchievements
{
	NSString* file = [NSHomeDirectory() stringByAppendingPathComponent:kCachedAchievementsFile];
	id object = [NSKeyedUnarchiver unarchiveObjectWithFile:file];

	if ([object isKindOfClass:[NSMutableDictionary class]])
	{
		NSMutableDictionary* loadedAchievements = (NSMutableDictionary*)object;
		cachedAchievements = [[NSMutableDictionary alloc] initWithDictionary:loadedAchievements];
	}
	else
	{
		cachedAchievements = [[NSMutableDictionary alloc] init];
	}
}

-(void) saveCachedAchievements
{
	NSString* file = [NSHomeDirectory() stringByAppendingPathComponent:kCachedAchievementsFile];
	[NSKeyedArchiver archiveRootObject:cachedAchievements toFile:file];
}

-(void) cacheAchievement:(GKAchievement*)achievement
{
	[cachedAchievements setObject:achievement forKey:achievement.identifier];

	// Save to disk immediately, to keep achievements around even if the game crashes.
	[self saveCachedAchievements];
}

-(void) uncacheAchievement:(GKAchievement*)achievement
{
	[cachedAchievements removeObjectForKey:achievement.identifier];

	// Save to disk immediately, to keep the removed cached achievement from being loaded again
	[self saveCachedAchievements];
}

#pragma mark Matchmaking

-(void) disconnectCurrentMatch
{
	[currentMatch disconnect];
	currentMatch.delegate = nil;
	[currentMatch release];
	currentMatch = nil;
}

-(void) setCurrentMatch:(GKMatch*)match
{
	if ([currentMatch isEqual:match] == NO)
	{
		[self disconnectCurrentMatch];
		currentMatch = [match retain];
		currentMatch.delegate = self;
	}
}

-(void) initMatchInvitationHandler
{
	if (isGameCenterAvailable == NO)
		return;

	[GKMatchmaker sharedMatchmaker].inviteHandler = ^(GKInvite* acceptedInvite, NSArray* playersToInvite)
	{
		[self disconnectCurrentMatch];

		if (acceptedInvite)
		{
			[self showMatchmakerWithInvite:acceptedInvite];
		}
		else if (playersToInvite)
		{
			GKMatchRequest* request = [[[GKMatchRequest alloc] init] autorelease];
			request.minPlayers = 2;
			request.maxPlayers = 4;
			request.playersToInvite = playersToInvite;

			[self showMatchmakerWithRequest:request];
		}
	};
}

-(void) findMatchForRequest:(GKMatchRequest*)request
{
	if (isGameCenterAvailable == NO)
		return;

	[[GKMatchmaker sharedMatchmaker] findMatchForRequest:request withCompletionHandler:^(GKMatch* match, NSError* error)
     {
         [self setLastError:error];

         if (match != nil)
         {
             [self setCurrentMatch:match];
             [delegate onMatchFound:match];
         }
     }];
}

-(void) addPlayersToMatch:(GKMatchRequest*)request
{
	if (isGameCenterAvailable == NO)
		return;

	if (currentMatch == nil)
		return;

	[[GKMatchmaker sharedMatchmaker] addPlayersToMatch:currentMatch matchRequest:request completionHandler:^(NSError* error)
     {
         [self setLastError:error];

         bool success = (error == nil);
         [delegate onPlayersAddedToMatch:success];
     }];
}

-(void) cancelMatchmakingRequest
{
	if (isGameCenterAvailable == NO)
		return;

	[[GKMatchmaker sharedMatchmaker] cancel];
}

-(void) queryMatchmakingActivity
{
	if (isGameCenterAvailable == NO)
		return;

	[[GKMatchmaker sharedMatchmaker] queryActivityWithCompletionHandler:^(NSInteger activity, NSError* error)
     {
         [self setLastError:error];

         if (error == nil)
         {
             [delegate onReceivedMatchmakingActivity:activity];
         }
     }];
}

#pragma mark Match Connection

-(void) match:(GKMatch*)match player:(NSString*)playerID didChangeState:(GKPlayerConnectionState)state
{
	switch (state)
	{
		case GKPlayerStateConnected:
			[delegate onPlayerConnected:playerID];
			break;
		case GKPlayerStateDisconnected:
			[delegate onPlayerDisconnected:playerID];
			break;
	}

	if (matchStarted == NO &#38;&#38; match.expectedPlayerCount == 0)
	{
		matchStarted = YES;
		[delegate onStartMatch];
	}
}

-(void) sendDataToAllPlayers:(void*)data length:(NSUInteger)length
{
	if (isGameCenterAvailable == NO)
		return;

	NSError* error = nil;
	NSData* packet = [NSData dataWithBytes:data length:length];
	[currentMatch sendDataToAllPlayers:packet withDataMode:GKMatchSendDataUnreliable error:&#38;error];
	[self setLastError:error];
}

-(void) match:(GKMatch*)match didReceiveData:(NSData*)data fromPlayer:(NSString*)playerID
{
	[delegate onReceivedData:data fromPlayer:playerID];
}

#pragma mark Views (Leaderboard, Achievements)

// Helper methods

-(UIViewController*) getRootViewController
{
	return [UIApplication sharedApplication].keyWindow.rootViewController;
}

-(void) presentViewController:(UIViewController*)vc
{
	UIViewController* rootVC = [self getRootViewController];
	[rootVC presentModalViewController:vc animated:YES];
}

-(void) dismissModalViewController
{
	UIViewController* rootVC = [self getRootViewController];
	[rootVC dismissModalViewControllerAnimated:YES];
}

// Leaderboards

-(void) showLeaderboard
{
	if (isGameCenterAvailable == NO)
		return;

	GKLeaderboardViewController* leaderboardVC = [[[GKLeaderboardViewController alloc] init] autorelease];
	if (leaderboardVC != nil)
	{
		leaderboardVC.leaderboardDelegate = self;
		[self presentViewController:leaderboardVC];
	}
}

-(void) leaderboardViewControllerDidFinish:(GKLeaderboardViewController*)viewController
{
	[self dismissModalViewController];
	//[delegate onLeaderboardViewDismissed]; //Loads Acheivements after ???
}

// Achievements

-(void) showAchievements
{
	if (isGameCenterAvailable == NO)
		return;

	GKAchievementViewController* achievementsVC = [[[GKAchievementViewController alloc] init] autorelease];
	if (achievementsVC != nil)
	{
		achievementsVC.achievementDelegate = self;
		[self presentViewController:achievementsVC];
	}
}

-(void) achievementViewControllerDidFinish:(GKAchievementViewController*)viewController
{
	[self dismissModalViewController];
	//[delegate onAchievementsViewDismissed];
}

// Matchmaking

-(void) showMatchmakerWithInvite:(GKInvite*)invite
{
	GKMatchmakerViewController* inviteVC = [[[GKMatchmakerViewController alloc] initWithInvite:invite] autorelease];
	if (inviteVC != nil)
	{
		inviteVC.matchmakerDelegate = self;
		[self presentViewController:inviteVC];
	}
}

-(void) showMatchmakerWithRequest:(GKMatchRequest*)request
{
	GKMatchmakerViewController* hostVC = [[[GKMatchmakerViewController alloc] initWithMatchRequest:request] autorelease];
	if (hostVC != nil)
	{
		hostVC.matchmakerDelegate = self;
		[self presentViewController:hostVC];
	}
}

-(void) matchmakerViewControllerWasCancelled:(GKMatchmakerViewController*)viewController
{
	[self dismissModalViewController];
	[delegate onMatchmakingViewDismissed];
}

-(void) matchmakerViewController:(GKMatchmakerViewController*)viewController didFailWithError:(NSError*)error
{
	[self dismissModalViewController];
	[self setLastError:error];
	[delegate onMatchmakingViewError];
}

-(void) matchmakerViewController:(GKMatchmakerViewController*)viewController didFindMatch:(GKMatch*)match
{
	[self dismissModalViewController];
	[self setCurrentMatch:match];
	[delegate onMatchFound:match];
}

@end</code></pre></description>
		</item>
		<item>
			<title>par02 on "Game Center Achievements - Utilize library w/out forcing user to log in?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/22072#post-122823</link>
			<pubDate>Mon, 24 Oct 2011 20:20:08 +0000</pubDate>
			<dc:creator>par02</dc:creator>
			<guid isPermaLink="false">122823@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I was just being lazy I guess...  thanks for the replies!</p>
<p>PAR
</p></description>
		</item>
		<item>
			<title>bryce on "Game Center Achievements - Utilize library w/out forcing user to log in?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/22072#post-122782</link>
			<pubDate>Mon, 24 Oct 2011 15:20:49 +0000</pubDate>
			<dc:creator>bryce</dc:creator>
			<guid isPermaLink="false">122782@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Since you're storing the data locally, why not always use that?
</p></description>
		</item>
		<item>
			<title>araker on "Game Center Achievements - Utilize library w/out forcing user to log in?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/22072#post-122772</link>
			<pubDate>Mon, 24 Oct 2011 14:38:08 +0000</pubDate>
			<dc:creator>araker</dc:creator>
			<guid isPermaLink="false">122772@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Game center needs a authenticated user, else other operations won't work. Authentication is only possible with the profiles stored on the device, so if the user doesn't want to log in, there is no possibility to retrieve something from game center.
</p></description>
		</item>
		<item>
			<title>par02 on "Game Center Achievements - Utilize library w/out forcing user to log in?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/22072#post-122763</link>
			<pubDate>Mon, 24 Oct 2011 13:58:10 +0000</pubDate>
			<dc:creator>par02</dc:creator>
			<guid isPermaLink="false">122763@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I apologize, I put this in the wrong forum and I do not see the ability for me to move it.</p>
<p>PAR
</p></description>
		</item>
		<item>
			<title>par02 on "Game Center Achievements - Utilize library w/out forcing user to log in?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/22072#post-122678</link>
			<pubDate>Sun, 23 Oct 2011 21:23:31 +0000</pubDate>
			<dc:creator>par02</dc:creator>
			<guid isPermaLink="false">122678@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>So, I have integrated Game Center into my game and have both leaderboards and achievements.  </p>
<p>My problem is simple, I am using achievements as gameplay mechanics meaning, when the player gets a certain achievement they unlock another part of the game.</p>
<p>The problem, if the player does NOT want to use Game Center, can I still use Game Center's ability to log into my game on iTunes connect and grab the achievements?  I *am* storing achievements locally in case of no connection but I am wondering if I need to actually build an entire Achievements UI for this possibility?</p>
<p>Thanks!</p>
<p>PAR
</p></description>
		</item>
		<item>
			<title>cybergreg on "Game Center Achievements Changing in iTunes Connect Later"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/12381#post-118359</link>
			<pubDate>Tue, 27 Sep 2011 11:30:19 +0000</pubDate>
			<dc:creator>cybergreg</dc:creator>
			<guid isPermaLink="false">118359@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>To clarify; from the latest version of the Developer Guide (v7.1) page 186 &#60;- has a nice chart showing you exactly what you can / cannot change</p>
<blockquote><p>￼NOTE: No Game Center metadata can be edited while the status of your Leaderboard or Achievement is In Review. This status corresponds with your Game Center-enabled binary being In Review</p></blockquote>
<p>However you can edit nearly everything(1) once it is not in review, as in approved, rejected, whatever.</p>
<p>Link for guide: <a href="http://itunesconnect.apple.com/docs/iTunesConnect_DeveloperGuide.pdf" rel="nofollow">http://itunesconnect.apple.com/docs/iTunesConnect_DeveloperGuide.pdf</a></p>
<p>Some critical items like leader board sort order and Achievement points cannot ever be changed once your app is live so get it right the first time! :-)
</p></description>
		</item>
		<item>
			<title>artemisworks on "Game Center Achievements Changing in iTunes Connect Later"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/12381#post-118358</link>
			<pubDate>Tue, 27 Sep 2011 11:16:39 +0000</pubDate>
			<dc:creator>artemisworks</dc:creator>
			<guid isPermaLink="false">118358@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Just saw this.</p>
<p>You can still change achievement icons etc. while your app is waiting for review. However when the app status changes to "In Review" you are blocked from making any further changes. So while it is tempting to wait until you have submitted your app for review before making the achievement icon graphics etc. it is best to get them all ready before you do so, or very nearly ready, because you don't know when your app status will change to being "In Review". This happened to me and I was unable to upload 2 remaining icons for my app.</p>
<p>Hope this helps.
</p></description>
		</item>
		<item>
			<title>MichaelB on "How do you guys manage achievements?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/20489#post-113978</link>
			<pubDate>Fri, 02 Sep 2011 03:28:28 +0000</pubDate>
			<dc:creator>MichaelB</dc:creator>
			<guid isPermaLink="false">113978@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>It should work to save as a file, then tell the OS to encrypt it.  </p>
<p><code>[[NSFileManager defaultManager] setAttributes:[NSDictionary dictionaryWithObjectsAndKeys:NSFileProtectionComplete, NSFileProtectionKey, nil] ofItemAtPath:scoreFile error:nil];</code>
</p></description>
		</item>
		<item>
			<title>bryce on "How do you guys manage achievements?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/20489#post-113958</link>
			<pubDate>Fri, 02 Sep 2011 00:21:39 +0000</pubDate>
			<dc:creator>bryce</dc:creator>
			<guid isPermaLink="false">113958@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I use an achievement manager class to keep track of my achievements and store everything in encrypted plists.
</p></description>
		</item>
		<item>
			<title>thaeez on "How do you guys manage achievements?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/20489#post-113947</link>
			<pubDate>Thu, 01 Sep 2011 22:23:54 +0000</pubDate>
			<dc:creator>thaeez</dc:creator>
			<guid isPermaLink="false">113947@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Thanks for the quick reply.</p>
<p>That's what I was afraid of. Do you encrypt the saved stats from the 'GameStats manager'? If not, does anyone know a good way to do this easily and still provide a little protection from people messing with the stats?
</p></description>
		</item>
		<item>
			<title>psykano on "How do you guys manage achievements?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/20489#post-113940</link>
			<pubDate>Thu, 01 Sep 2011 21:44:52 +0000</pubDate>
			<dc:creator>psykano</dc:creator>
			<guid isPermaLink="false">113940@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Well that's pretty much what I do except I also have a 'GameStats manager' to keep track of things like how many baddies have been killed. That way, I have some achievements which unlock at the end of a level and some which unlock during the course of a level but I'm not necessarily checking if they have been unlocked every update. If you are using OpenFeint to communicate and synchronize with Game Center then you shouldn't need to keep track of achievements yourself since OpenFeint does it for you but if you want Game Center achievement support without the necessity of having OpenFeint enabled then, unfortunately, you will need to duplicate a means of keeping track of achievements.
</p></description>
		</item>
		<item>
			<title>thaeez on "How do you guys manage achievements?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/20489#post-113932</link>
			<pubDate>Thu, 01 Sep 2011 21:24:16 +0000</pubDate>
			<dc:creator>thaeez</dc:creator>
			<guid isPermaLink="false">113932@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi all,</p>
<p>I'm working on adding GameCenter/OpenFeint support for my game and currently have OpenFeint working well with custom notifications. Now, I want to create a few achievements but I can't wrap my head around what the best way of tracking events in the game might be, and before I jump in and do a lot of coding, I'd like to ask for some opinions...</p>
<p>If I have an achievement that gets unlocked when someone kills 500 baddies, it seems like I'll need some sort 'achievement manager' class that can be called every time a baddie gets killed to keep a running kill count - once it reaches 500, it will post the achievement. Simple enough, or so I thought, but it appears the devil is in the details. I think this means that in addition to maintaining a list of achievements on GC and OF, I'll need to keep a local copy around as well. Does anyone have a workaround for this? Also, how do you guys save achievement progress, unlocked items, etc. in a somewhat secure manner as to prevent someone on a jailbroken device from simply changing keys in your plist/xml/sql? I know there is no REALLY secure solution, but I would like to prevent non-techies from making simple changes to unlock stuff.</p>
<p>Is this how you guys are keeping track of achievement progress, or is there a better way that I'm just not seeing?</p>
<p>Thanks in advance.</p>
<p>Mike
</p></description>
		</item>
		<item>
			<title>Daniel López on "Achievements repeating and repeating and repeating..."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/18806#post-105602</link>
			<pubDate>Mon, 18 Jul 2011 14:00:38 +0000</pubDate>
			<dc:creator>Daniel López</dc:creator>
			<guid isPermaLink="false">105602@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>hmmmm I've done it by myself, I've loaded the achievements in a variable called "achievements" like a NSDictionariy, and it works well, just I load the achievements once and then I always check this Dictionary, I am a little bit "asleepy" I've cached them locally but I didn't realize xD</p>
<p>Thanks for all.
</p></description>
		</item>
		<item>
			<title>cybergreg on "Achievements repeating and repeating and repeating..."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/18806#post-105596</link>
			<pubDate>Mon, 18 Jul 2011 12:45:52 +0000</pubDate>
			<dc:creator>cybergreg</dc:creator>
			<guid isPermaLink="false">105596@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>@<a href='http://www.cocos2d-iphone.org/forum/profile/3667'>Daniel</a>, check cocos2d-central.com (and buy Steffens book). His GameKitHelper uses a cached approach to download scores and achievements when the app launches. After that when submitting to Game Center, both Game Center and the locally cached object (high score or Achievement) are updated. Makes it very easy and fast to check for a new high score or achievement completed. His code also provides many valuable delegate callbacks.
</p></description>
		</item>
		<item>
			<title>Daniel López on "Achievements repeating and repeating and repeating..."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/18806#post-105586</link>
			<pubDate>Mon, 18 Jul 2011 11:55:06 +0000</pubDate>
			<dc:creator>Daniel López</dc:creator>
			<guid isPermaLink="false">105586@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I did it using this code</p>
<pre><code>-(void) reportAchievementWithID:(NSString*)identifier percentComplete:(float)percent{
    GKAchievement* achievement = [self getAchievementByID:identifier];
    if (achievement != nil &#38;&#38; achievement.percentComplete &#60; percent) {
            achievement.showsCompletionBanner = YES;
            achievement.percentComplete = percent;
            [achievement reportAchievementWithCompletionHandler: ^(NSError* error){ }];
    }
}</code></pre>
<p>But now, I will try doing this:<br />
<pre><code>-(void) reportAchievementWithID:(NSString*)identifier percentComplete:(float)percent{
    GKAchievement* achievement = [self getAchievementByID:identifier];
    if (achievement != nil &#38;&#38; achievement.percentComplete &#60; percent) {
        if (!achievement.isCompleted){
            achievement.showsCompletionBanner = YES;
            achievement.percentComplete = percent;
            [achievement reportAchievementWithCompletionHandler: ^(NSError* error){ }];
        }
    }
}</code></pre>
<p>And! I don't store nothing locally... Should I?<br />
BTW! I am on iOS 5.</p>
<p>That was you mean before?</p>
<p>And about completion banner, just I execute this line of code, very easy, and the result it's so nice<br />
<code>achievement.showsCompletionBanner = YES;</code></p>
<p>PS: The new Code worked but... Still with the doubt about If I should store the data locally, to don't ask the server again and again... Isn't it?
</p></description>
		</item>
		<item>
			<title>cybergreg on "Achievements repeating and repeating and repeating..."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/18806#post-105531</link>
			<pubDate>Mon, 18 Jul 2011 02:23:48 +0000</pubDate>
			<dc:creator>cybergreg</dc:creator>
			<guid isPermaLink="false">105531@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>No problem, there are several forks, check them out</p>
<p><a href="https://github.com/jfro/BCAchievementNotification" rel="nofollow">https://github.com/jfro/BCAchievementNotification</a>
</p></description>
		</item>
		<item>
			<title>zaaroth on "Achievements repeating and repeating and repeating..."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/18806#post-105518</link>
			<pubDate>Mon, 18 Jul 2011 01:01:34 +0000</pubDate>
			<dc:creator>zaaroth</dc:creator>
			<guid isPermaLink="false">105518@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Cool! Could you provide a link? I have looked for it without luck.
</p></description>
		</item>
		<item>
			<title>cybergreg on "Achievements repeating and repeating and repeating..."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/18806#post-105517</link>
			<pubDate>Mon, 18 Jul 2011 00:26:11 +0000</pubDate>
			<dc:creator>cybergreg</dc:creator>
			<guid isPermaLink="false">105517@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Re: banner<br />
In iOS5 it can provide a banner however BCNotifications (on github) are much more flexible.
</p></description>
		</item>
		<item>
			<title>zaaroth on "Achievements repeating and repeating and repeating..."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/18806#post-105515</link>
			<pubDate>Mon, 18 Jul 2011 00:14:10 +0000</pubDate>
			<dc:creator>zaaroth</dc:creator>
			<guid isPermaLink="false">105515@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Ha! I spent about 4 minutes writing this. How sad. I wish I could erase that post :-)
</p></description>
		</item>
		<item>
			<title>zaaroth on "Achievements repeating and repeating and repeating..."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/18806#post-105514</link>
			<pubDate>Mon, 18 Jul 2011 00:13:36 +0000</pubDate>
			<dc:creator>zaaroth</dc:creator>
			<guid isPermaLink="false">105514@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hey, you got me curious.</p>
<p>On my implementation I had to come up with a banner myself. Didnt you do your banner yourself? Is there a gamecenter baked banner?</p>
<p>Anyway, in order to avoid dupes I retrieve the achievements once the user logs in and then I just update achievements that arent already completed. I think this is explained in apple's documentation.</p>
<p>In any layer of gamecenter, being leaderboards or achievements, you can always throw an update towards gamecenter. The thing is that it will accept the new value and only update its database in case the value is higher than the one it already has. Only actual errors are reported (user not online, wifi issues, whatever).</p>
<p>Let me know if this wasnt clear.
</p></description>
		</item>
		<item>
			<title>cybergreg on "Achievements repeating and repeating and repeating..."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/18806#post-105512</link>
			<pubDate>Mon, 18 Jul 2011 00:09:01 +0000</pubDate>
			<dc:creator>cybergreg</dc:creator>
			<guid isPermaLink="false">105512@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Your fault :-)</p>
<p>I check for achievement.completed and against achievement.percentComplete. It can several seconds before Game Center registers the completed flag. I also use Steffen's GameKitHelper.</p>
<p>How are you tracking / storing your Game Center data locally?</p>
<p>PS I'm seeing completely opposite results for achievement.completed in iOS 5 compared to iOS 4.3
</p></description>
		</item>

	</channel>
</rss>

