SDKs

Our SDKs provide an easy way to quickly integrate ChilliConnect in to your game. We currently provide both a Unity and an iOS SDK and will soon be adding Android and ChilliSource. If the SDK you want is currently unavailable you can still call our HTTP API directly.

Unity

Download

I agree to the Terms of Service

The Unity SDK describes a C# API for ChilliConnect and comes bundled as a Unity Package which can be easily added to your project. The SDK is written entirely in C# and does not require any plugins. The following details how to install and use the SDK. You can also browse the Doxygen documentation.

Installation

Follow these steps to include ChilliConnect in your Unity project:

Usage

The following describes the steps requested to setup ChilliConnect in your Unity project.

using ChilliConnect;
var chilliConnect = new ChilliConnectSdk("<YourGameToken>", false);
var metrics = chilliConnect.Metrics;
Action<StartSessionRequest> successCallback = (StartSessionRequest request) =>
{
    UnityEngine.Debug.Log("Successfully started session!");
};

Action<StartSessionRequest, StartSessionError> errorCallback = (StartSessionRequest request, StartSessionError error) =>
{
    UnityEngine.Debug.Log("An error occurred while starting the session: " + error.ErrorDescription);
};

metrics.StartSession(userId, "Unity-v1.0", successCallback, errorCallback);
chilliConnect.Dispose();

See the full API documentation for more information on the available modules and methods.

iOS

Download

I agree to the Terms of Service

The iOS SDK provides an Objective-C API for ChilliConnect that iOS developers should find easy to use. The following sections detail how to install and use the SDK. You can also browse the Doxygen documentation.

Installation

Follow the below steps to add the iOS SDK to your project:

Usage

The following are the steps required to setup the ChilliConnect iOS SDK for use in your project.

#import <ChilliConnect/ChilliConnect.h>
CCChilliConnectSdk *chilliConnect = [CCChilliConnectSdk chilliConnectSdkWithAppToken:@"<YourGameToken>" verboseLogging:NO];
CCMetrics *metrics = chilliConnect.metrics;
CCStartSessionResponseCallback successCallback = ^(CCStartSessionRequest *request) {
    NSLog(@"Successfully started session!");
};

CCStartSessionErrorCallback errorCallback = ^(CCStartSessionRequest *request, CCStartSessionError *error) {
    NSLog(@"An error occurred while starting a metrics session: %@", error.errorDescription);
};

[metrics startSessionWithUserId:userId appVersion:@"1.0" successCallback:successCallback errorCallback:errorCallback];

For more information on the different requests available in each module, see the full API documentation.

Android

ChilliSource

HTTP

The easiest way to integrate ChilliConnect in to your game is to use one of our published SDKs. However, if the SDK you want is not currently available, all ChilliConnect functionality is exposed through an easy to use HTTPS API that you can invoke directly from your game.

The API is separated in to modules and exposed through two separate end points. Each API endpoint is also versioned, with the current version being 1.0. The following table describes the end point for each module:

Module Domain
Cloud Code https://connect.chilliconnect.com/1.0
Cloud Data https://connect.chilliconnect.com/1.0
Economy https://connect.chilliconnect.com/1.0
Leaderboards https://connect.chilliconnect.com/1.0
Messaging https://connect.chilliconnect.com/1.0
Player Accounts https://connect.chilliconnect.com/1.0
Push Notifications https://connect.chilliconnect.com/1.0
IAP Validation https://connect.chilliconnect.com/1.0
DLC https://connect.chilliconnect.com/1.0
Metrics https://metrics.chilliconnect.com/1.0
Live Ops https://connect.chilliconnect.com/1.0

The API for both Connect and Metrics follow a similar usage pattern. For both, you must first use your GameToken, available from your ChilliConnect dashboard, to authenticate and obtain an AccessToken. You then use this AccessToken on subsequent requests. For Metrics, a MetricsAccessToken is obtained by invoking the StartSession end point. For Connect, a ConnectAccessToken is obtained by logging in a Player with one of the Player Login endpoints – for example, LogInUsingChilliConnect. Note that AccessTokens are not interchangeable between Metrics and Connect API endpoints.

To call a specific method on the API simply post the required JSON body to the URL indicated in the documentation below to the relevant endpoint whilst setting the Content-Type header to "application/json". For example, the below curl command shows how to call the CreatePlayer method:

curl \
 -H "Content-Type: application/json" \\
 -H "Game-Token: <YourGameTokenHere>" \
 -X POST https://connect.chilliconnect.com/1.0/player/create