Type Method

reportScores:withEligibleChallenges:withCompletionHandler:

Submit a list of scores and all eligible challenges.

Declaration

+ (void)reportScores:(NSArray<GKScore *> *)scores withEligibleChallenges:(NSArray<GKChallenge *> *)challenges withCompletionHandler:(void (^)(NSError *error))completionHandler;

Parameters

scores

An array of GKScore objects that contains all of the scores to be reported.

challenges

An array of GKChallenge objects that represents all challenges associated with the reported scores. If an error occurred, this parameter may be non-nil, in which case the array holds whatever challenge information GameKit 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, GameKit calls your completion handler. The completion handler is always called on the main thread.

See Also

Reporting a New Score

+ reportScores:withCompletionHandler:

Reports a list of scores to Game Center