GPGAchievementMetadata Class Reference

GPGAchievementMetadata Class Reference

Overview

The metadata for a single achievement.

This object is not meant to be instantiated directly. In order to retrieve metadata for an achievement you must use [GPGAchievementMetadata allMetadataWithCompletionHandler:].

[GPGAchievementMetadata allMetadataWithCompletionHandler:(GPGAchievementAllMetadataBlock)completionHandler];

Static Public Member Functions

(void) + metadataForAchievementId:completionHandler:
 Returns the GPGAchievementMetadata with a matching achievementId.
(void) + metadataForAchievementId:dataSource:completionHandler:
 Returns the GPGAchievementMetadata with a matching achievementId.
(void) + allMetadataWithCompletionHandler:
 Returns all of achievment metadata for the game.
(void) + allMetadataFromDataSource:completionHandler:
 Returns all of achievment metadata for the game.

Properties

NSString * achievementId
 The unique identifier for the achievement.
GPGAchievementState state
 The last known state of the achievement.
GPGAchievementType type
 The type of the achievement.
NSString * name
 The name of the achievement.
NSString * achievementDescription
 The description of the achievement.
NSURL * revealedIconUrl
 The icon that is displayed when the achievement is revealed.
NSURL * unlockedIconUrl
 The icon that is displayed when the achievement is in an unlocked state.
int32_t completedSteps
 The number of steps completed toward an incremental achievement.
int32_t numberOfSteps
 The total number of steps in an incremental achievement.
NSString * formattedCompletedSteps
 A string of the number of steps completed toward an incremental achievement.
NSString * formattedNumberOfSteps
 A string of the total number of steps in an incremental achievement.
int64_t lastUpdatedTimestamp
 The server timestamp of the last time this was updated.
CGFloat progress
 The percentage progress of this achievement.
int32_t experiencePoints
 The number of experience points awarded by this achievement.

Member Function Documentation

+ (void) metadataForAchievementId: (NSString *)  achievementId
completionHandler: (GPGAchievementMetadataBlock)  completionHandler 

Returns the GPGAchievementMetadata with a matching achievementId.

If not found, will return nil.

Parameters:
achievementIdThe achievementId to find.
completionHandlerA block in the form: ^(GPGAchievementMetadata *metadata, NSError *error)
+ (void) metadataForAchievementId: (NSString *)  achievementId
dataSource: (GPGDataSource)  dataSource
completionHandler: (GPGAchievementMetadataBlock)  completionHandler 

Returns the GPGAchievementMetadata with a matching achievementId.

If not found, will return nil.

Parameters:
achievementIdThe achievementId to find.
dataSourceThe data source from where to load.
completionHandlerA block in the form: ^(GPGAchievementMetadata *metadata, NSError *error)
+ (void) allMetadataWithCompletionHandler: (GPGAchievementAllMetadataBlock)  completionHandler

Returns all of achievment metadata for the game.

Parameters:
completionHandlerA block in the form: ^(NSArray *metadata, NSError *error)
+ (void) allMetadataFromDataSource: (GPGDataSource)  dataSource
completionHandler: (GPGAchievementAllMetadataBlock)  completionHandler 

Returns all of achievment metadata for the game.

Parameters:
dataSourceThe data source from where to load.
completionHandlerA block in the form: ^(NSArray *metadata, NSError *error)

Property Documentation

- (NSString*) achievementId [read, copy]

The unique identifier for the achievement.

- (GPGAchievementState) state [read, assign]

The last known state of the achievement.

Achievements have a transitioning state of hidden => locked => unlocked. For example, unlocking an achievement implicitly reveals it.

- (GPGAchievementType) type [read, assign]

The type of the achievement.

- (NSString*) name [read, copy]

The name of the achievement.

This is generally a short one-line title composed of a few words.

- (NSString*) achievementDescription [read, copy]

The description of the achievement.

This is generally a multi-line description of what the gamer must do to unlock the achievement.

- (NSURL *) revealedIconUrl [read, copy]

The icon that is displayed when the achievement is revealed.

Override URL getters to include a default size.

- (NSURL *) unlockedIconUrl [read, copy]

The icon that is displayed when the achievement is in an unlocked state.

- (int32_t) completedSteps [read, assign]

The number of steps completed toward an incremental achievement.

- (int32_t) numberOfSteps [read, assign]

The total number of steps in an incremental achievement.

- (NSString*) formattedCompletedSteps [read, copy]

A string of the number of steps completed toward an incremental achievement.

- (NSString*) formattedNumberOfSteps [read, copy]

A string of the total number of steps in an incremental achievement.

- (int64_t) lastUpdatedTimestamp [read, assign]

The server timestamp of the last time this was updated.

- (CGFloat) progress [read, assign]

The percentage progress of this achievement.

Calculated as completedSteps / numberOfSteps. Range: 0...1 (1 being 100% completed).

If numberOfSteps is 0, this returns 0.

- (int32_t) experiencePoints [read, assign]

The number of experience points awarded by this achievement.