Game Kit Constants Reference

Framework
GameKit/GKError.h
Companion guide
Declared in
GKError.h

Overview

This document describes the constants defined in the Game Kit framework that are not described in a document for an individual class.

Constants

GKErrorDomain

The Game Kit framework error domain.

NSString * const GKErrorDomain;
Constants
GKErrorDomain

An error occurred in Game Kit.

Available in OS X v10.8 and later.

Declared in GKError.h.

Discussion

GKSession and GKVoiceChatService define their own error domains.

Game Kit Errors

Error codes for the Game Kit error domain.

enum {
   GKErrorUnknown = 1,
   GKErrorCancelled = 2,
   GKErrorCommunicationsFailure = 3,
   GKErrorUserDenied = 4,
   GKErrorInvalidCredentials = 5,
   GKErrorNotAuthenticated = 6,
   GKErrorAuthenticationInProgress = 7,
   GKErrorInvalidPlayer = 8,
   GKErrorScoreNotSet = 9,
   GKErrorParentalControlsBlocked = 10,
   GKErrorMatchRequestInvalid = 13,
   GKErrorUnderage = 14,
   GKErrorGameUnrecognized = 15,
   GKErrorNotSupported = 16,
   GKErrorInvalidParameter = 17,
   GKErrorUnexpectedConnection = 18,
   GKErrorChallengeInvalid = 19,
   GKErrorTurnBasedMatchDataTooLarge = 20,
   GKErrorTurnBasedTooManySessions = 21,
   GKErrorTurnBasedInvalidParticipant = 22,
   GKErrorTurnBasedInvalidTurn = 23,
   GKErrorTurnBasedInvalidState = 24,
   GKErrorOffline = 25,
};
typedef NSInteger GKErrorCode;
Constants
GKErrorUnknown

An unexpected error occurred.

Available in OS X v10.8 and later.

Declared in GKError.h.

GKErrorCancelled

The requested operation has been cancelled or disabled by the user.

Available in OS X v10.8 and later.

Declared in GKError.h.

GKErrorCommunicationsFailure

An error occurred when communicating with Game Center.

Available in OS X v10.8 and later.

Declared in GKError.h.

GKErrorUserDenied

The operation was denied by the user.

GKErrorUserDenied is only called when Game Center is restricted in Parental Controls or has been turned off entirely in the configuration profile. All other user cancelled actions use GKErrorCancelled.

Available in OS X v10.8 and later.

Declared in GKError.h.

GKErrorInvalidCredentials

The operation failed because the player’s user name or password or both are incorrect.

Available in OS X v10.8 and later.

Declared in GKError.h.

GKErrorNotAuthenticated

The local player has not been authenticated.

Available in OS X v10.8 and later.

Declared in GKError.h.

GKErrorAuthenticationInProgress

The local player is currently authenticating.

Available in OS X v10.8 and later.

Declared in GKError.h.

GKErrorInvalidPlayer

A player object or identifier is invalid.

Available in OS X v10.8 and later.

Declared in GKError.h.

GKErrorScoreNotSet

A score value was not set before attempting to post the score.

Available in OS X v10.8 and later.

Declared in GKError.h.

GKErrorParentalControlsBlocked

The feature has been blocked by the user.

Available in OS X v10.8 and later.

Declared in GKError.h.

GKErrorMatchRequestInvalid

The match request’s properties are impossible to fulfill. For example, the minimum number of players cannot be larger than the maximum number of players.

Available in OS X v10.8 and later.

Declared in GKError.h.

GKErrorUnderage

The feature is disabled because the local player is underage.

Available in OS X v10.8 and later.

Declared in GKError.h.

GKErrorGameUnrecognized

Game Center does not recognize the application that made the request. Make sure the bundle identifier is set properly for the application.

Available in OS X v10.8 and later.

Declared in GKError.h.

GKErrorNotSupported

The device does not support Game Center.

Available in OS X v10.8 and later.

Declared in GKError.h.

GKErrorInvalidParameter

One or more of the parameters was incorrect.

For example, this error code may be returned if your application attempts to post a score and provides a category string that does not match a category you configured for your leaderboards on iTunes Connect.

Available in OS X v10.8 and later.

Declared in GKError.h.

GKErrorUnexpectedConnection

An unexpected player has connected to a match.

Available in OS X v10.8 and later.

Declared in GKError.h.

GKErrorChallengeInvalid

The challenge was invalid.

Available in OS X v10.8 and later.

Declared in GKError.h.

GKErrorTurnBasedMatchDataTooLarge

Your game submitted data that exceeded the maximum size that Game Center permits for a turn-based game.

Available in OS X v10.8 and later.

Declared in GKError.h.

GKErrorTurnBasedTooManySessions

The requested operation could not be completed because it would exceed the maximum number of sessions.

Available in OS X v10.8 and later.

Declared in GKError.h.

GKErrorTurnBasedInvalidParticipant

One of the participant objects you provided was invalid.

Available in OS X v10.8 and later.

Declared in GKError.h.

GKErrorTurnBasedInvalidTurn

The requested operation could not be completed because the specified participant does not have the required turn state."

Available in OS X v10.8 and later.

Declared in GKError.h.

GKErrorTurnBasedInvalidState

The requested operation could not be completed because the session is in an invalid state.

Available in OS X v10.8 and later.

Declared in GKError.h.

GKErrorOffline

The requested operation could not be completed because the device is not online.

Available in OS X v10.8 and later.

Declared in GKError.h.