I set up an achievement for passing the first level of my game and it works but when i replay the level and pass it it shows the notification banner again, how can i prevent this from happening?
Use this method to submit the achievement:
-(void) reportAchievementWithID:(NSString*) achievementID {
[GKAchievement loadAchievementsWithCompletionHandler:^(NSArray *achievements, NSError *error) {
if(error) NSLog(@"error reporting ach");
for (GKAchievement *ach in achievements) {
if([ach.identifier isEqualToString:achievementID]) { //already submitted
return ;
}
}
GKAchievement *achievementToSend = [[GKAchievement alloc] initWithIdentifier:achievementID];
achievementToSend.percentComplete = 100;
achievementToSend.showsCompletionBanner = YES;
[achievementToSend reportAchievementWithCompletionHandler:NULL];
}];
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With