Kartridge Unity/.NET API Documentation
Kongregate.KartridgeConstants Class Reference

This class includes constants for utilizing the native Kartridge C++ API. More...

Public Attributes

const string KONGREGATE_EVENT_READY = "ready"
 Event broadcast when the API has been fully initialized and it has successfully communicated with the Kartridge application for the first time. More...
 
const string KONGREGATE_EVENT_CONNECTED = "connected"
 Event broadcast when the API has connected to the Kartridge application process. More...
 
const string KONGREGATE_EVENT_DISCONNECTED = "disconnected"
 Event broadcast when the API has disconnected from the Kartridge application process. More...
 
const string KONGREGATE_EVENT_SHUTDOWN = "shutdown"
 Event broadcast when the API is shutting down. More...
 
const string KONGREGATE_EVENT_USER = "user"
 Event broadcast once user information is available. More...
 
const string KONGREGATE_EVENT_AUTH_TOKEN = "auth_token"
 Event broadcast when the Kongregate authentication token is received or changed. More...
 
const string KONGREGATE_EVENT_LIBRARY = "library"
 Event broadcast when the list of currently owned or installed games has been received or updated. More...
 
const string KONGREGATE_EVENT_ITEMS = "items"
 Event broadcast when the list of items for the game is available, this will be fired after the API is initialized. More...
 
const string KONGREGATE_EVENT_ITEM_INSTANCES = "item_instances"
 Event broadcast when the list of item instances owned by the user changes. More...
 
const string KONGREGATE_EMPTY_EVENT_PAYLOAD = "{}"
 An empty JSON event payload. More...
 
const string KONGREGATE_EMPTY_STRING = ""
 An empty string. More...
 
const string KONGREGATE_GUEST_USERNAME = "Guest"
 Username representing a guest user - "Guest". More...
 

Detailed Description

This class includes constants for utilizing the native Kartridge C++ API.

Member Data Documentation

§ KONGREGATE_EMPTY_EVENT_PAYLOAD

const string Kongregate.KartridgeConstants.KONGREGATE_EMPTY_EVENT_PAYLOAD = "{}"

An empty JSON event payload.

§ KONGREGATE_EMPTY_STRING

const string Kongregate.KartridgeConstants.KONGREGATE_EMPTY_STRING = ""

An empty string.

§ KONGREGATE_EVENT_AUTH_TOKEN

const string Kongregate.KartridgeConstants.KONGREGATE_EVENT_AUTH_TOKEN = "auth_token"

Event broadcast when the Kongregate authentication token is received or changed.

If your game uses the token, it should authenticate with your server when this event is fired. This event can be fired if either the user or token changes. It will follow the KONGREGATE_EVENT_USER event if the user has changed as well. In general, if your application needs to use auth tokens, you can just listen for this event and ignore KONGREGATE_EVENT_USER.

See also
KartridgeBindings.KongregateServices_GetGameAuthToken
KONGREGATE_EVENT_USER

§ KONGREGATE_EVENT_CONNECTED

const string Kongregate.KartridgeConstants.KONGREGATE_EVENT_CONNECTED = "connected"

Event broadcast when the API has connected to the Kartridge application process.

This event is for advanced usage and can typically be ignored.

See also
KONGREGATE_EVENT_DISCONNECTED

§ KONGREGATE_EVENT_DISCONNECTED

const string Kongregate.KartridgeConstants.KONGREGATE_EVENT_DISCONNECTED = "disconnected"

Event broadcast when the API has disconnected from the Kartridge application process.

This event is for advanced usage and can typically be ignored.

See also
KONGREGATE_EVENT_CONNECTED

§ KONGREGATE_EVENT_ITEM_INSTANCES

const string Kongregate.KartridgeConstants.KONGREGATE_EVENT_ITEM_INSTANCES = "item_instances"

Event broadcast when the list of item instances owned by the user changes.

This will happen when the API is initialized, when the current user purchases or consumes an item, or when the user changes. This event will be always be fired after KONGREGATE_EVENT_USER. When this event is fired it is good practice to enumerate the items and consume any unconsumed items since it is possible that items may have been awarded outside of the game via badges, customer services tools, etc.

See also
KartridgeBindings.KongregateIAP_ConsumeItemInstance
KartridgeBindings.KongregateIAP_PurchaseItem
KONGREGATE_EVENT_USER

§ KONGREGATE_EVENT_ITEMS

const string Kongregate.KartridgeConstants.KONGREGATE_EVENT_ITEMS = "items"

Event broadcast when the list of items for the game is available, this will be fired after the API is initialized.

Once this event is fired you may call KongregateIAP_GetItems to enumerate the items defined for the current game. This event will not be fired if the game has not enabled the IAP API in the publishing settings.

See also
KartridgeBindings.KongregateIAP_GetItems

§ KONGREGATE_EVENT_LIBRARY

const string Kongregate.KartridgeConstants.KONGREGATE_EVENT_LIBRARY = "library"

Event broadcast when the list of currently owned or installed games has been received or updated.

This will happen when the API is initialized, when the current user purchases a game, or when the user changes. This event will be always be fired after KONGREGATE_EVENT_USER.

See also
KartridgeBindings.KongregateLibrary_IsGameOwned
KartridgeBindings.KongregateLibrary_IsGameInstalled
KONGREGATE_EVENT_USER

§ KONGREGATE_EVENT_READY

const string Kongregate.KartridgeConstants.KONGREGATE_EVENT_READY = "ready"

Event broadcast when the API has been fully initialized and it has successfully communicated with the Kartridge application for the first time.

After this event is fired, KartridgeBindings.KongregateAPI_IsReady will return true.

Generally, you will want to wait for KONGREGATE_EVENT_USER or KONGREGATE_EVENT_AUTH_TOKEN if you need information about the current user.

See also
KartridgeBindings.KongregateAPI_IsReady
KONGREGATE_EVENT_USER
KONGREGATE_EVENT_AUTH_TOKEN

§ KONGREGATE_EVENT_SHUTDOWN

const string Kongregate.KartridgeConstants.KONGREGATE_EVENT_SHUTDOWN = "shutdown"

Event broadcast when the API is shutting down.

This event is for advanced usage and can typically be ignored.

§ KONGREGATE_EVENT_USER

const string Kongregate.KartridgeConstants.KONGREGATE_EVENT_USER = "user"

Event broadcast once user information is available.

Before this event is broadcast for the first time, users will be treated as guests. Once this event is received, the user ID and username returned will match the user that is logged into Kartridge (if any).

This event will be fired again any time the user signs out or signs in with a different Kongregate account, so you should handle it accordingly.

The game authentication token may not be available when this event is fired. If you need the authentication token, you should wait for the KONGREGATE_EVENT_AUTH_TOKEN event instead.

See also
KartridgeBindings.KongregateServices_GetUsername
KartridgeBindings.KongregateServices_GetUserId
KONGREGATE_EVENT_AUTH_TOKEN

§ KONGREGATE_GUEST_USERNAME

const string Kongregate.KartridgeConstants.KONGREGATE_GUEST_USERNAME = "Guest"

Username representing a guest user - "Guest".