Skip to main content

API Reference

Core Loop

Launch Skillz UI

This method is overloaded
void SkillzCrossPlatform.LaunchSkillz();

Legacy:

void SkillzCrossPlatform.LaunchSkillz(SkillzMatchDelegate matchDelegate);
Parameters

Legacy: matchDelegate A reference to a SkillzMatchDelegate instance that Skillz will use


Update Current Score

Call this method every time the player's score changes during a Skillz match.

This method is overloaded
void SkillzCrossPlatform.UpdatePlayersCurrentScore(string score);
Parameters

score The player's current score as a string


Submit Score

Call this method when a player finishes a match. This will send the score to Skillz and conclude the match. This will not send the user back to the Skillz UI

This method is overloaded
void SkillzCrossPlatform.SubmitScore(string score, Action successCallback, Action<string> failureCallback)
Parameters

score Player's final score as a string

successCallback Implementation of the System.Action delegate that handles successful submission

failureCallback Implementation of the System.Action delegate that handles failed submission


End Replay

End the current replay if one exists and returns the status of the score submission. Must be called after score has been submitted. Use to end replay recording at conclusion of the match and before user is presented with personalized progression room metrics.

bool EndReplay()
Returns

Boolean true if end replay was successful, false if the user has not submitted a score for the match


Return to Skillz

The ReturnToSkillz method presents the Skillz UI. This must be called after the score has been submitted with the SubmitScore method. After the SubmitScore has been called you can present users with relevant statistics such as high score and present content to enhance the game experience.

In all cases, it will return a boolean, indicating whether or not it is able to return the user to Skillz. For the case of a match in progress, unless a score has been submitted, this method will return false and the user will not be returned to Skillz. If a score has been submitted, it returns true and returns the user to Skillz.

bool SkillzCrossPlatform.ReturnToSkillz()
Returns

Boolean indicating whether it is able to return the user to Skillz UI


Abort Match

Forfeits the current match and returns to the Skillz UI.

void SkillzCrossPlatform.AbortMatch()

Display Tournament Results With Score

The DisplayTournamentResultsWithScore method replaces the deprecated ReportFinalScore method. Skillz recommends that you try to use the SubmitScore and ReturnToSkillz methods. However, DisplayTournamentResultsWithScore can be used as a failsafe if the SubmitScore method fails.

This method is overloaded

void SkillzCrossPlatform.DisplayTournamentResultsWithScore(string score)
Parameters

score Player's final score as a string



Audio API

Get SFX Volume

Gets the volume for sound effects in your game.

float SkillzCrossPlatform.getSFXVolume()
Returns

A float between 0 and 1, inclusive


Set SFX Volume

Sets the volume for the sound effects in your game.

void SkillzCrossPlatform.setSFXVolume(float volume)
Parameters

volume A float between 0 and 1, inclusive


Get Background Music Volume

Gets the volume for the background music that is played in the Skillz UI.

float SkillzCrossPlatform.getSkillzMusicVolume()
Returns

A float between 0 and 1, inclusive


Set Background Music Volume

Sets the volume of the background music that plays in the Skillz UI.

void SkillzCrossPlatform.setSkillzMusicVolume(float volume)
Parameters

volume A float between 0 and 1, inclusive


Set Background Music

Specifies the music file to play as background music while in the Skillz UI.

void SkillzCrossPlatform.setSkillzBackgroundMusic(string fileName)
Parameters

fileName Path to the music file to play in the background of the Skillz UI



Progression API

Progression Namespace Constants

Calls to the progression methods must use one of the three namespace string values. Each namespace return a separate list of key-value pairs for for that namespace:

  • DefaultPlayerData For read-only Skillz player data and is game-specific.
  • PlayerData For publisher-defined player data and is game-specific.
  • InGameItems For publisher-defined player data and is shared across all games in publisher's portfolio.
ProgressionNamespace.DEFAULT_PLAYER_DATA
ProgressionNamespace.PLAYER_DATA
ProgressionNamespace.IN_GAME_ITEMS

Get Progression User Data

Retrieve data for the current user. This method requires callback methods that allow you to handle success and fail scenarios.

void SkillzCrossPlatform.GetProgressionUserData(string progressionNamespace, List<string> userDataKeys, Action<Dictionary<string, ProgressionValue>> successCallback, Action<string> failureCallback)
Parameters

progressionNamespace One of the namespace String constants

userDataKeys String key list of desired fields.

successCallback Action delegate to handle successful callback. The method must be defined in the implementation.

failureCallback Action delegate to handle failed callback. The method must be defined in the implementation.


Update Progression User Data

Write data for the current user. This method requires callback methods that allow you to handle success and fail scenarios. Can update up to 25 elements per call.

Note

The DefaultPlayerData namespace is read-only, and cannot be used with this method.

void SkillzCrossPlatform.UpdateProgressionUserData(string progressionNamespace, Dictionary<string, object> userDataUpdates, Action successCallback, Action<string> failureCallback)
Parameters

progressionNamespace One of the namespace String constants

userDataUpdates Dictionary of key/value pairs to be updated

successCallback Action delegate to handle successful callback. The method must be defined in the implementation

failureCallback Action delegate to handle failed callback. The method must be defined in the implementation



Seasons API

Get Current Season

Fetch the full season of the current Season based on start and end time if one is currently active. This method uses callbacks to handle the successful fetch or an error if one occurs. If no season is active, this method will call the given success handler with null.

void SkillzCrossPlatform.GetCurrentSeason(Action<Season> successCallback, Action<string> failureCallback
Parameters

successCallback Action delegate to handle successful callback and the returned Season object. The method must be defined in the implementation

failureCallback Action delegate to handle the failure callback and the returned error string. The method must be defined in the implementation

Get Previous Seasons

Fetch the full seasons of previous Seasons based on start and end time in chronological order. This returns previous seasons based on a given count. The seasons returned are fetched to include the most recent season. For example, if requesting the previous 2 seasons, it will fetch the 2 most recently completed seasons in chronological order. The most recently ended season will be the end of the list. When no previous seasons exist, the fetch will return an empty list. The given count must be greater than 0. If the count is greater than the total number of previous seasons, as many previous seasons as possible will be returned.

void SkillzCrossPlatform.GetPreviousSeasons(int count, Action<List<Season>> successCallback, Action<string> failureCallback)
Parameters

count Number of previous seasons requested

successCallback Action delegate to handle success callback and the returned List of Season objects. The method must be defined in the implementation

failureCallback Action delegate to handle the failure callback and the returned error string. The method must be defined in the implementation

Get Next Seasons

Fetch the full seasons of upcoming Seasons based on start and end time in chronological order. This returns upcoming seasons based on a given count. The seasons returned are fetched to include the most recent season. For example, if requesting the next 2 seasons, it will fetch the 2 upcoming seasons with the closest start times in chronological order. The closest season to starting will be the first season of the list. When no upcoming seasons exist, the fetch will return an empty list. The given count must be greater than 0. If the count is greater than the total number of upcoming seasons, as many upcoming seasons as possible will be returned.

void SkillzCrossPlatform.GetNextSeasons(int count, Action<List<Season>> successCallback, Action<string> failureCallback)
Parameters

count Number of upcoming seasons requested

successCallback Action delegate to handle success callback and the returned List of Season objects. The method must be defined in the implementation

failureCallback Action delegate to handle the failure callback and the returned error string. The method must be defined in the implementation



Random Generator

Random Value

Use the Skillz random implementation to ensure each competitor receives the exact same random number.

float SkillCrossPlatform.Random.Value()
Returns

A generated pseudo random float value


Random Value Ranged

This method is overloaded
int SkillzCrossPlatform.Random.Range(int min, int max)
Parameters

min The minimum int value for the range

max The maximum int value for the range

Returns

A generated pseudo random int value within the given range

NOTE

The Random function Range(int min, int max) requires the min and max value range (max-min) to be no larger than Int.MaxValue to prevent overflow


Random Point Inside Unit Sphere

Generate a point inside the unit sphere using Value().

Vector3 SkillzCrossPlatform.Random.InsideUnitSphere();
Returns

A new Vector3 object


Random Point Inside Unit Circle

Find a point inside the unit circle using Value().

Vector2 SkillzCrossPlatform.Random.InsideUnitCircle();
Returns

A new Vector2 object


Random Point On Unit Sphere

Hybrid rejection / trig method to generate points on a sphere using Value().

Vector3 SkillzCrossPlatform.Random.OnUnitSphere();
Returns

A new Vector3 object


Random Quaternion in Rotation

Quaternion random using Value().

Quaternion SkillzCrossPlatform.Random.Rotation();
Returns

A new Quaternion object


Random Quaternion in Rotation Uniform

Quaternion random using Value().

Quaternion SkillzCrossPlatform.Random.RotationUniform();
Returns

A new Quaternion object



Helpers

Get Match Info

SkillzSDK.Match SkillzCrossPlatform.GetMatchInfo();
Returns

A Match object containing information about the current match in progress


Get Match Rules

Returns the match gameplay parameters that you set up in the Skillz Developer Console for each tournament type

Hashtable SkillzCrossPlatform.GetMatchRules();
Returns

Hashtable containing the gameplay parameters of the current match


Get Player

Gets the currently logged in player info. This will return an empty object if a Skillz player has not been created yet.

SkillzSDK.Player SkillzCrossPlatform.GetPlayer();
Returns

A Player object


Get Player Details

Gets the currently logged in player info. Can be used outside of tournaments. Android only.

Does not exist in Unity. Use Get Player


Get SDK Version

Gets the version of the Skillz SDK your game is being run on.

string SkillzCrossPlatform.SDKVersionShort();
Returns

Skillz SDK version as a string


Get User Name

Returns the current Skillz user display name.

Does not exist in Unity. Use Get Player


Is Match In Progress

Checks if a match is currently in progress.

bool SkillzCrossPlatform.IsMatchInProgress();
Returns

A boolean indicating if a match if is in progress


Register Push Token

Enables an app to receive push notifications.

Does not exist in Unity

Set Metadata for Match In Progress

Updates the meta data for a Skillz match in progress to track player actions, level types, or other information pertinent to the Skillz integration. There should be no more than 10 key/value pairs in the supplied collection. Data will only be available to Skillz to help identify fairness in level-based games.

void SkillzCrossPlatform.AddMetadataForMatchInProgress(string metadataJson, bool forMatchInProgress)
Parameters

attributes String representing the meta data in a JSON string

forMatchInProgress Boolean to check whether the user is in a Skillz game



Sync API

Is Match Completed

This will return whether or not another client connected to this match has called either displaySynchronousTournamentResultsWithScore or initiateSynchronousAbortWithCompletion: to end the match.

bool SkillzCrossPlatform.IsMatchCompleted()
Returns

Boolean indicating whether or not the match has been completed


Send Data

Sends a message to all clients connected to this match. This will trigger SkillzSyncDelegate::onDidReceiveData: on all clients connected to the current match.

Note: NSData passed to this function are limited to a certain size based on the game, and this function will assert if over that size. (2048 bytes currently).

void SkillzCrossPlatform.SendData(byte[] data)
Parameters

data The message to be sent, max 2048 bytes



Skillz Delegate

These methods are part of the Skillz Delegate interface, to be implemented in your Skillz Delegate

On Tournament Start

Called when a player enters a tournament from Skillz

interface SkillzMatchDelegate
void OnMatchWillBegin(Match matchInfo) {}
Parameters

matchInfo Match contains data relevant to the current match including player info

  • Required to implement
  • Setup and loading of gameplay scene is performed here

On Progression Room Entry

Called when a user enters the Progression Room via Menu -> Progression Room or Progression Entry Point

interface SkillzMatchDelegate
void OnProgressionRoomEnter() {}
  • Required to implement, but can be left empty
  • Construct and display the progression experience scene here

On Skillz Exit

Called when a user exits the Skillz experience via Menu -> Exit

interface SkillzMatchDelegate
void OnSkillzWillExit() {}
  • Optional to implement
  • Return to the game menu scene here

On Skillz Finished Launching

Called once the Skillz UI has finished rendering

Not available in Unity

On Skillz Will Launch

Called before the Skillz UI launches

Not available in Unity

On New Paying User (NPU) Conversion

Called at the moment when a player joins a match that leads to the player becoming a New Paying User (NPU) through this game. When triggered, it is called just before the On Tournament Start Skillz Delegate method.

interface SkillzMatchDelegate
void OnNPUConversion() {}
  • Optional to implement


Objects

Real-Time Server Connection Info

CustomServerConnectionInfo

PropertyData TypeDescription
isBotMatchboolIndicates if the match is a sync bot match
MatchIdstringThe ID of the real-time match
MatchTokenstringAn encrypted token to help validate the session server side
ServerIpstringThe hostname or IP for the match
ServerPortstringThe port for the game server


Match Info

Match

PropertyData TypeDescription
BracketRoundint?Indicates the round of the bracket tournament if IsBracket is true
CustomServerConnectionInfoCustomServerConnectionInfoThe connection info to a custom server that coordinates a real-time match
DescriptionstringThe description of this tournament type
EntryCashfloat?If this tournament is being played for real cash, this is the amount of cash required to enter
EntryPointsint?If this tournament is being played for Z, this is the amount of Z required to enter.
GameParamsDictionary<string, string>The custom parameters for this tournament type specified in the developer portal
IDulong?The unique ID for the match
IsBracketboolIndicates the match is a bracketed tournament
IsCashbool?Indicates the match is for real prizes or for Z
IsCustomSynchronousMatchboolIndicates if the match is a sync match
IsSynchronousboolDeprecated. Indicates if this match is Sync. Note: please use the IsCustomSynchronousMatch property
IsTieBreakerboolIndicates whether the match is a tie-breaker
IsVideoAdEntrybool?Indicates the match entry was through a video ad
NamestringName of the match
PlayersList<Player>List of players in the match
SkillzDifficultyuint?The difficulty of the game (used with automatic difficulty). Note: only set in production.
TemplateIDint?The unique ID for the tournament template this match is based on


Player Info

Player

PropertyData TypeDescription
AvatarURLstringA link to the user's avatar image
DisplayNamestringPlayer name
FlagURLstringA link to the user's country's flag image
IDulong?The ID unique to this user
IsCurrentPlayerboolThis Player represents the current user if this is true
IsNewPayingUserboolIf true, the player made their first ever deposit with Skillz in any game, and then played their first pro tournament in this game. Can only return true if IsCurrentPlayer is also true.
TournamentPlayerIDulong?A Tournament Player ID unique to this user


Progression Metadata

ProgressionMetadata

PropertyData TypeDescription
GameIdsList<string>List of relevant game IDs for the associated ProgressionValue


Progression Value

ProgressionValue

PropertyData TypeDescription
DataTypestringThe data type for the stored value
DisplayNamestringThe display name for the stored value
LastUpdatedTimeDateTimeThe timestamp of when the data was last updated on Skillz servers in UTC
MetadataProgressionMetadataThe metadata for this progression value
ValuestringThe stored value for this progression value


Skillz Player Info

Does not exist in Unity. Use Player Info