Skip to main content
Version: 27.1.3

API Reference

Get Skillz Instance

The main point of interaction with Skillz.

SkillzCrossPlatform

Methods

Abort Match

Forfeits the current match and returns to the Skillz UI.

public static 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

public static void SkillzCrossPlatform.DisplayTournamentResultsWithScore(string score)
Parameters

score The player's final score as a string.


End Replay

End the current replay if one exists and returns the status of the score submission.

public static bool EndReplay()
Returns

True if end replay was successful and false if the user has not submitted a score for the match.


Get Match Info

public static Match GetMatchInfo();
Returns

A Match object containing information about the current match in progress.


Get Match Rules

Returns the match rules that you set up in the Skillz Developer Console for each match type.

public static Hashtable GetMatchRules();
Returns

A Hashtable containing a key-value pair for each rule of the current match type.


Get Player

Gets information about the player.

public static SkillzSDK.Player GetPlayer();
Returns

A Player object.


Get Player Detailed

Returns a detailed Skillz Player object with more fields to describe a player.


Get Progression User Data

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

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

progressionNamespace One of the namespace String contstants

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.


Get SDK Version

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

public static string SDKVersionShort();
Returns

The Skillz SDK's version as a string.


Get SFX Volume

Gets the volume for sound effects in your game.


Get User Name

Returns the current Skillz user display name.


Init with Game ID

Initializes Skillz with the specified game ID.


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.

func isMatchCompleted() -> Bool {
}
Returns

A boolean indicating whether or not the match has been completed.


Is Match In Progress

Checks if a match is currently in progress.

public static bool IsMatchInProgress();
Returns

A boolean indicating if a match if is in progress.


Get Background Music Volume

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


Launch Skillz UI

Launches the SKillz UI

This method is overloaded
public static void  SkillzCrossPlatform.LaunchSkillz(SkillzMatchDelegate _matchDelegate);
Parameters

_matchDelegate A reference to a SkillzMatchDelegate instance that Skillz will use.


Random Value

Use the Skillz random implementation to ensure each competitor recieves 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().

public static Vector3 InsideUnitSphere();

Random Point Inside Unit Circle

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

public static Vector2 InsideUnitCircle();

Random Point On Unit Sphere

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

public static Vector3 OnUnitSphere();

Random Quaternion in Rotation Uniform

Quaternion random using Value().

public static Quaternion RotationUniform();

Random Quaternion in Rotation

Quaternion random using Value().

public static Quaternion Rotation();

Report Final Score (Deprecated)

Call this method when a player finishes a match. This will report the result of the game to the Skillz server, and return the player to the Skillz UI.

This method is overloaded

public static void ReportFinalScore(String score)
Parameters

score The player's final score as a string.


Register Push Token

Enables an app to receive push notifications.


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.

public static bool SkillzCrossPlatform.ReturnToSkillz()
Returns

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


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).


Set Background Music

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


Set Background Music Volume

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


Set Metadata for Match In Progress

Updates the meta data for a Skillz match in progress.


Set SFX Volume

Sets the volume for the sound effects in your game.


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
public static void SkillzCrossPlatform.SubmitScore(string score, Action successCallback, Action<string> failureCallback)
Parameters

score The 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 failures.


Update Player Current Score

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

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

score The player's current score as a string.


Update Progression User Data

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

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

progressionNamespace One of the namespace String contstants

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.


Objects

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

PropertyData TypeDescription
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
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
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

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
TournamentPlayerIDulong?A Tournament Player ID unique to this user

ProgressionMetadata

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

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

Constants

Progression Namespace Constants

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

  • PlayerData For publisher-defined player data and is game-specfiic.
ProgressionNamespace.PLAYER_DATA