Type Method

reportAchievements:withEligibleChallenges:withCompletionHandler:

Reports a list of achievements and limits the challenges those achievements may complete.

Declaration

+ (void)reportAchievements:(NSArray<GKAchievement *> *)achievements withEligibleChallenges:(NSArray<GKChallenge *> *)challenges withCompletionHandler:(void (^)(NSError *error))completionHandler;

Parameters

achievements

An array of GKAchievement objects that represents all achievements that are being reported.

challenges

An array of GKChallenge objects that represents the limited challenges that are associated with the reported achievements. If an error occurred, this parameter may be non-nil, in which case the array holds whatever challenge information Game Kit was able to fetch.

completionHandler

A block to be called when the download is completed.

The block receives the following parameter:

error

If an error occurred, this object describes the error. If the operation completed successfully, this value is nil.

Discussion

When this method is called, it creates a new background task to handle the request. The method then returns control to your game. Later, when the task is complete, Game Kit calls your completion handler. The completion handler is always called on the main thread.

See Also

Reporting Progress on Achievements

+ reportAchievements:withCompletionHandler:

Reports progress on an array of achievements.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software