Submitting Scores

When authenticated with Game Center, you are ready to begin submitting scores. In the IFCGameCenterManager class there is a method called reportScore:forCategory. This allows you to post a new score for the Leaderboard ID that was configured in iTunes Connect. All new scores are submitted by creating a new GKScore object; this object holds onto several values such as the score value, playerID, date, rank, formattedValue, category, and context.

When a new score is submitted, most of this data is automatically populated. The value and category are the only two required fields. An optional context can be provided which is an arbitrary 64-bit unsigned integer. A context can be used to store additional information about the score, ...

Get iOS Components and Frameworks: Understanding the Advanced Features of the iOS SDK now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.