API Reference
Core Loop
Launch Skillz UI
- Unity/C#
- iOS/Swift
- iOS/Objective-C
- Android/Java
- Asynchronous
- Synchronous
void SkillzCrossPlatform.LaunchSkillz(SkillzMatchDelegate matchDelegate);
Parameters
matchDelegate
A reference to a SkillzMatchDelegate
instance that Skillz will use
void SkillzCrossPlatform.LaunchSkillz(SkillzSyncDelegate syncMatchDelegate);
Parameters
syncMatchDelegate
A reference to a SkillzSyncDelegate
instance that Skillz will use
func initWithGameId(
gameId: String,
forDelegate: SkillzBaseDelegate,
withEnvironment: SkillzEnvironment,
allowExit: Bool)
Parameters
gameId
The ID string of your game that is created from the Skillz Developer Console
forDelegate
Reference to a SkillzDelegate
instance
withEnvironment
The Skillz server environment your game will run in. It can be either SkillzSandbox
or SkillzProduction
allowExit
Specifies if the user can exit the Skillz UI via the sidebar menu
- (void)initWithGameId:(NSString *)
forDelegate:(<SkillzBaseDelegate>)
withEnvironment:(SkillzEnvironment)
allowExit:(BOOL)
Parameters
initWithGameId
The ID string of your game that is created from the Skillz Developer Console
forDelegate
Reference to a SkillzDelegate
instance
withEnvironment
The Skillz server environment your game will run in. It can be either SkillzSandbox
or SkillzProduction
allowExit
Specifies if the user can exit the Skillz UI via the sidebar menu. This can be either YES
or NO
void Skillz.launch(Activity activity)
Update Current Score
Call this method every time the player's score changes during a Skillz match.
- Unity/C#
- iOS/Swift
- iOS/Objective-C
- Android/Java
- string
- int
- float
void SkillzCrossPlatform.UpdatePlayersCurrentScore(string score);
Parameters
score
The player's current score as a string
void SkillzCrossPlatform.UpdatePlayersCurrentScore(int score);
Parameters
score
The player's current score as an integer
void SkillzCrossPlatform.UpdatePlayersCurrentScore(float score);
Parameters
score
The player's current score as a float
- without Match ID
- with Match ID
func updatePlayersCurrentScore(currentScoreForPlayer: NSNumber)
Parameters
currentScoreForPlayer
The players current score as NSNumber
func updatePlayersCurrentScore(
currentScoreForPlayer: NSNumber,
withMatchId: NSNumber)
Parameters
currentScoreForPlayer
The players current score as NSNumber
withMatchId
The match ID as NSNumber
- without Match ID
- with Match ID
- (void)updatePlayersCurrentScore: (NSNumber *)
Parameters
updatePlayersCurrentScore
The players current score as an NSNumber
- (void)updatePlayersCurrentScore: (NSNumber *)
withMatchId: (NSNumber *)
Parameters
updatePlayersCurrentScore
The players current score as NSNumber
withMatchId
The match ID as NSNumber
void updatePlayersCurrentScore(Activity activity, BigDecimal score, String matchId)
Parameters
activity
Current activity context
score
Player's updated score
matchId
ID of the current match
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
- Unity/C#
- iOS/Swift
- iOS/Objective-C
- Android/Java
- string
- int
- float
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
void SkillzCrossPlatform.SubmitScore(int score, Action successCallback, Action<string> failureCallback)
Parameters
score
Player's final score as an integer
successCallback
Implementation of the System.Action delegate that handles successful submission
failureCallback
Implementation of the System.Action delegate that handles failed submission
void SkillzCrossPlatform.SubmitScore(float score, Action successCallback, Action<string> failureCallback)
Parameters
score
Player's final score as a float
successCallback
Implementation of the System.Action delegate that handles successful submission
failureCallback
Implementation of the System.Action delegate that handles failed submission
func submitScore(score: NSNumber,
withSuccess: () -> Void,
withFailure: (String) -> Void)
Parameters
score
The score for the match
withSuccess
Success completion block
withFailure
Failure completion block, returns string error message
- (void)submitScore: (NSNumber *)
withSuccess: ^(void)
withFailure: ^(NSString *) errorMessage
Parameters
submitScore
The score for the match
withSuccess
Success completion block
withFailure
Failure completion block, returns string error message
void Skillz.submitScore(@NonNull final Activity activity, BigDecimal score, String matchId, SkillzScoreCallback callback)
Parameters
activity
The activity to report the score from
score
Score to report in BigDecimal
matchId
ID of the current match
callback
SkillzScoreCallback
that is called upon completion
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.
- Unity/C#
- iOS/Swift
- iOS/Objective-C
- Android/Java
bool EndReplay()
Returns
Boolean true if end replay was successful, false if the user has not submitted a score for the match
func endReplayRecording() -> Bool
Returns
Boolean true if end replay was successful and false if the user has not submitted a score for the match
- (BOOL)endReplayRecording
Returns
Boolean true if end replay was successful and 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.
- Unity/C#
- iOS/Swift
- iOS/Objective-C
- Android/Java
bool SkillzCrossPlatform.ReturnToSkillz()
Returns
Boolean indicating whether it is able to return the user to Skillz UI
func returnToSkillzWithCompletion(completion: () -> Void) -> BOOL
Parameters
completion
Completion block
Returns
Boolean indicating whether it is able to return the user to Skillz UI
- (BOOL)returnToSkillzWithCompletion:^(void)
Parameters
returnToSkillzWithCompletion
Completion block
Returns
Boolean indicating whether it is able to return the user to Skillz UI
boolean Skillz.returnToSkillz(@NonNull final Activity activity, String matchId)
Parameters
activity
Current activity context
matchId
ID of the match just being played, send null
if not in a match
Abort Match
Forfeits the current match and returns to the Skillz UI.
- Unity/C#
- iOS/Swift
- iOS/Objective-C
- Android/Java
void SkillzCrossPlatform.AbortMatch()
- without Match ID
- with Match ID
- bot match
func notifyPlayerAbort(completion: () -> Void)
Parameters
completion
Callback to invoke after the method has completed execution
func notifyPlayerAbort(withMatchId: NSNumber,
withCompletion: () -> Void)
Parameters
withMatchId
Match ID as NSNumber
withCompletion
Callback to invoke after the method has completed execution
func notifyPlayerAbortForBotMatch(withBotScore: NSNumber?,
completion: () -> Void)
Parameters
withBotScore
Bot score as NSNumber
completion
Callback to invoke after the method has completed execution
- without Match ID
- with Match ID
- bot match
- (void)notifyPlayerAbortWithCompletion: ^(void)
Parameters
notifyPlayerAbortWithCompletion
Completion block
- (void)notifyPlayerAbortWithMatchId: (NSNumber *)
WithCompletion: ^(void)
Parameters
notifyPlayerAbortWithMatchId
Match ID as NSNumber
WithCompletion
Completion block
- (void)notifyPlayerAbortForBotMatchWithBotScore:(NSNumber * _Nullable)
completion:^(void)
Parameters
notifyPlayerAbortForBotMatchWithBotScore
Bot score as NSNumber
completion
Completion block
void Skillz.abortMatch(Activity activity)
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.
- Unity/C#
- iOS/Swift
- iOS/Objective-C
- Android/Java
This method is overloaded
- string
- int
- float
void SkillzCrossPlatform.DisplayTournamentResultsWithScore(string score)
Parameters
score
Player's final score as a string
void SkillzCrossPlatform.DisplayTournamentResultsWithScore(int score)
Parameters
score
Player's final score as an integer
void SkillzCrossPlatform.DisplayTournamentResultsWithScore(float score)
Parameters
score
Player's final score as a float
- without Match ID
- with Match ID
- bot match
func displayTournamentResults(withScore: NSNumber,
withCompletion: () -> Void)
Parameters
withScore
NSNumber score value
withCompletion
Completion block
func displayTournamentResults(withScore: NSNumber,
withMatchId: NSNumber,
withCompletion: () -> Void)
Parameters
withScore
Player score as NSNumber
withMatchId
Match ID as NSNumber
withCompletion
Completion block
func displayResultsForBotMatch(withPlayerScore: NSNumber,
botScore: NSNumber,
withCompletion: () -> Void)
Parameters
withPlayerScore
Player score as NSNumber
botScore
Bot score as NSNumber
withCompletion
Completion block
- without Match ID
- with Match ID
- bot match
- (void)displayTournamentResultsWithScore: (NSNumber *)
withCompletion: ^(void))
Parameters
displayTournamentResultsWithScore
Player score as NSNumber
WithCompletion
Completion block
- (void)displayTournamentResultsWithScore: (NSNumber *)
withMatchId: (NSNumber *)
withCompletion: ^(void))
Parameters
displayTournamentResultsWithScore
Player score as NSNumber
withMatchId
Match ID as NSNumber
WithCompletion
Completion block
- (void)displayResultsForBotMatchWithPlayerScore: (NSNumber *)
botScore: (NSNumber *)
withCompletion: ^(void))
Parameters
displayResultsForBotMatchWithPlayerScore
Player score as NSNumber
botScore
Bot score as NSNumber
WithCompletion
Completion block
void Skillz.displayTournamentResultsWithScore(@NonNull final Activity activity, BigDecimal score, String matchId)
Parameters
activity
Current activity context
score
The score to report in BigDecimal
matchId
The id of the current match
Audio API
Get SFX Volume
Gets the volume for sound effects in your game.
- Unity/C#
- iOS/Swift
- iOS/Objective-C
- Android/Java
Set SFX Volume
Sets the volume for the sound effects in your game.
- Unity/C#
- iOS/Swift
- iOS/Objective-C
- Android/Java
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.
- Unity/C#
- iOS/Swift
- iOS/Objective-C
- Android/Java
Set Background Music Volume
Sets the volume of the background music that plays in the Skillz UI.
- Unity/C#
- iOS/Swift
- iOS/Objective-C
- Android/Java
void SkillzCrossPlatform.setSkillzMusicVolume(float volume)
Parameters
volume
A float between 0 and 1, inclusive
func backgroundMusicVolume(volumeLevel: GCFloat)
Parameters
musicVolume
GCFloat
between 0 and 1, inclusive
- (void)setBackgroundMusicVolume: (GCFloat)
Parameters
setBackgroundMusicVolume
GCFloat
between 0 and 1, inclusive
void SkillzAudio.setSkillzMusicVolume(float volume)
Parameters
volume
float
between 0 and 1, inclusive
Set Background Music
Specifies the music file to play as background music while in the Skillz UI.
- Unity/C#
- iOS/Swift
- iOS/Objective-C
- Android/Java
void SkillzCrossPlatform.setSkillzBackgroundMusic(string fileName)
Parameters
fileName
Path to the music file to play in the background of the Skillz UI
func setBackgroundMusicFile(fileName: String) -> BOOL
Parameters
fileName
Path the music file to play in the background of the Skillz UI
Returns
Boolean indicating whether pathname passed validation
- (BOOL)setBackgroundMusicFile: (NSString*)
Parameters
setBackgroundMusicFile
Music file to play in the background of the Skillz UI
Returns
Boolean indicating whether pathname passed validation
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.
- Unity/C#
- iOS/Swift
- iOS/Objective-C
- Android/Java
ProgressionNamespace.DEFAULT_PLAYER_DATA
ProgressionNamespace.PLAYER_DATA
ProgressionNamespace.IN_GAME_ITEMS
ProgressionNamespaceDefaultPlayerData
ProgressionNamespacePlayerData
ProgressionNamespaceInGameItems
ProgressionNamespaceDefaultPlayerData
ProgressionNamespacePlayerData
ProgressionNamespaceInGameItems
ProgressionNamespace.DefaultPlayerData
ProgressionNamespace.PlayerData
ProgressionNamespace.InGameItems
Get Progression User Data
Retrieve data for the current user. This method requires callback
methods that allow you to handle success and fail scenarios.
- Unity/C#
- iOS/Swift
- iOS/Objective-C
- Android/Java
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.
func getUserData(forNamespace: String!,
withKeys: NSMutableArray!,
withSuccess: ([AnyHashable : Any]?) -> Void,
withFailure: (String?) -> Void)
forNamespace
One of the String constants
withKeys
NSMutableArray
of desired field key Strings
withSuccess
Function to handle callback success and AnyHashable return data object
withFailure
Function to handle callback failure and String error message
- (void)getUserDataForNamespace: (NSString *)
withKeys: (NSMutableArray *)
withSuccess: ^(NSDictionary *userData)
withFailure: ^(NSString *error)
Parameters
getUserDataForNamespace
One of the NSString constants
withKeys
String key NSMutableArray of desired fields
withSuccess
Function to handle callback success and NSDictionary return data object
withFailure
Function to handle callback failure and NSString error message
void SkillzProgression.getUserData(String namespace, List<String> userDataKeys, ProgressionCallback callback)
Parameters
namespace
One of the namespace String constants
userDataKeys
String key list of desired fields.
callback
ProgressionCallback object to handle callback success or failure. Must be defined in 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.
- Unity/C#
- iOS/Swift
- iOS/Objective-C
- Android/Java
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
func updateUserData(forNamespace: String!,
withUserData: [AnyHashable : Any]!,
withSuccess: ([AnyHashable : Any]?) -> Void,
withFailure: (String?) -> Void)
Parameters
forNamespace
One of the String constants
withUserData
AnyHashable of key/value pairs to be updated
withSuccess
Function to handle callback success and AnyHashable return data object
withFailure
Function to handle callback failure and String error message
- (void)updateUserDataForNamespace: (NSString *)
withUserData: (NSDictionary *)
withSuccess: ^(NSDictionary *userData)
withFailure: ^(NSString *error)
Parameters
updateUserDataForNamespace
One of the NSString constants
withUserData
Dictionary of key/value pairs to be updated
withSuccess
Function to handle callback success and NSDictionary return data object
withFailure
Function to handle callback failure and NSString error message
void SkillzProgression.updateUserData(String namespace, Map<String, Object> userDataUpdates, ProgressionCallback callback)
Parameters
namespace
One of the namespace String constants
userDataUpdates
Map of String/Object key/value pairs.
callback
ProgressionCallback
object to handle callback success or failure. Must be defined in 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
.
- Unity/C#
- iOS/Swift
- iOS/Objective-C
- Android/Java
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
func getCurrentSeason(_ successCallback: (SKZSeason?) -> Void,
withFailure failureCallback: (String?) -> Void)
Parameters
successCallback
Function to handle callback success and SKZSeason return data object
failureCallback
Function to handle callback failure and String error message
- (void)getCurrentSeason: ^(SKZSeason *season)successCallback
withFailure: ^(NSString *error)failureCallback
Parameters
successCallback
Function to handle success callback and SKZSeason return data object
failureCallback
Function to handle failure callback and NSString error message
void SkillzProgression.getCurrentSeason(CurrentSeasonCallback callback)
Parameters
callback
Implementation of CurrentSeasonCallback
interface
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.
- Unity/C#
- iOS/Swift
- iOS/Objective-C
- Android/Java
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
func getPreviousSeasons( _ count: Int32,
withSuccess successCallback: (NSArray?) -> Void,
withFailure failureCallback: (String?) -> Void)
Parameters
count
Number of previous seasons requested
successCallback
Function to handle success callbackand NSArray
of SKZSeason
return data object
failureCallback
Function to handle failure callback and String
error message
- (void)getPreviousSeasons: (int)count
withSuccess: ^(NSArray *seasons))successCallback
withFailure: ^(NSString *error))failureCallback
Parameters
count
Number of previous seasons requested
successCallback
Function to handle success callback and NSArray
of SKZSeason
return data object
failureCallback
Function to handle failure callback and NSString
error message
void SkillzProgression.getPreviousSeasons(long count, MultipleSeasonCallback callback)
Parameters
count
Number of previous seasons requested
callback
Implementation of MultipleSeasonCallback
interface
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.
- Unity/C#
- iOS/Swift
- iOS/Objective-C
- Android/Java
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
func getNextSeasons( _ count: Int32,
withSuccess successCallback: (NSArray?) -> Void,
withFailure failureCallback: (String?) -> Void)
Parameters
count
Number of previous seasons requested
successCallback
Function to handle success callback and NSArray
of SKZSeason
return data object
failureCallback
Function to handle failure callback and String
error message
- (void)getNextSeasons: (int)count
withSuccess: ^(NSArray *seasons)successCallback
withFailure: ^(NSString *error)failureCallback
Parameters
count
Number of previous seasons requested
successCallback
Function to handle success callback and NSArray
of SKZSeason
return data object
failureCallback
Function to handle failure callback and NSString
error message
void SkillzProgression.getNextSeasons(long count, MultipleSeasonCallback callback)
Parameters
count
Number of previous seasons requested
callback
Implementation of MultipleSeasonCallback
interface
Random Generator
Random Value
Use the Skillz random implementation to ensure each competitor receives the exact same random number.
- Unity/C#
- iOS/Swift
- iOS/Objective-C
- Android/Java
Random Value Ranged
- Unity/C#
- iOS/Swift
- iOS/Objective-C
- Android/Java
- int
- float
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 thanInt.MaxValue
to prevent overflow
float SkillzCrossPlatform.Random.Range(float min, float max)
Parameters
min
The minimum float value for the range
max
The maximum float value for the range
Returns
A generated pseudo random float value within the given range
NOTE
The Random function
Range(float min, float max)
requires the min and max value range (max-min) to be no larger thanFloat.MaxValue
to prevent overflow
func getRandomNumber(withMin: UInt,
andMax: UInt) -> UInt
Parameters
withMin
The minimum UInt
value for the range
withMax
The maximum UInt
value for the range
Returns
A generated pseudo random UInt
value within the given range
+ (NSUInteger)getRandomNumberWithMin: (NSUInteger)
andMax: (NSUInteger)
Parameters
getRandomNumberWithMin
The minimum NSInteger
value for the range
andMax
The maximum NSInteger
value for the range
Returns
A generated pseudo random NSInteger
value within the given range
Random Point Inside Unit Sphere
Generate a point inside the unit sphere using Value()
.
- Unity/C#
- iOS/Swift
- iOS/Objective-C
- Android/Java
Random Point Inside Unit Circle
Find a point inside the unit circle using Value()
.
- Unity/C#
- iOS/Swift
- iOS/Objective-C
- Android/Java
Random Point On Unit Sphere
Hybrid rejection / trig method to generate points on a sphere using Value()
.
- Unity/C#
- iOS/Swift
- iOS/Objective-C
- Android/Java
Random Quaternion in Rotation
Quaternion random using Value()
.
- Unity/C#
- iOS/Swift
- iOS/Objective-C
- Android/Java
Random Quaternion in Rotation Uniform
Quaternion random using Value()
.
- Unity/C#
- iOS/Swift
- iOS/Objective-C
- Android/Java
Helpers
Get Match Info
- Unity/C#
- iOS/Swift
- iOS/Objective-C
- Android/Java
Get Match Rules
Returns the match gameplay parameters that you set up in the Skillz Developer Console for each tournament type
- Unity/C#
- iOS/Swift
- iOS/Objective-C
- Android/Java
Hashtable SkillzCrossPlatform.GetMatchRules();
Returns
Hashtable
containing the gameplay parameters of the current match
func getMatchRules() -> [AnyHashable : Any]
Returns
AnyHashable
containing the gameplay parameters of the current match
+ (NSDictionary *)getMatchRules
Returns
NSDictionary
pointer containing the gameplay parameters of the current match
Map<String,String> getMatchRules()
Returns
Map
containing the gameplay parameters for the current match
Get Player
Gets information about the player from inside a tournament.
- Unity/C#
- iOS/Swift
- iOS/Objective-C
- Android/Java
Get Player Details
Gets the currently logged in player info. Can be used outside of tournaments. Android only.
- Unity/C#
- iOS/Swift
- iOS/Objective-C
- Android/Java
Does not exist in Unity. Use Get Player
Does not exist in Swift. Use Get Player
Does not exist in Objective-C. Use Get Player
Get SDK Version
Gets the version of the Skillz SDK your game is being run on.
- Unity/C#
- iOS/Swift
- iOS/Objective-C
- Android/Java
Get User Name
Returns the current Skillz user display name.
- Unity/C#
- iOS/Swift
- iOS/Objective-C
- Android/Java
Does not exist in Unity. Use Get Player
Does not exist in Swift. Use Get Player
Does not exist in Objective-C. Use Get Player
Is Match In Progress
Checks if a match is currently in progress.
- Unity/C#
- iOS/Swift
- iOS/Objective-C
- Android/Java
bool SkillzCrossPlatform.IsMatchInProgress();
Returns
A boolean indicating if a match if is in progress
Register Push Token
Enables an app to receive push notifications.
- Unity/C#
- iOS/Swift
- iOS/Objective-C
- Android/Java
Does not exist in Swift
Does not exist in Objective-C
void registerPushToken(Context context, java.lang.String pushToken)
Parameters
context
The current application's context to receive Skillz push notifications.
pushToken
The device's Firebase push token.
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.
- Unity/C#
- iOS/Swift
- iOS/Objective-C
- Android/Java
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
func addMetadata([AnyHashable : Any,
forMatchInProgress: Bool)
Parameters
addMetadata
AnyHashable
of key/value pairs to update
forMatchInProgress
Boolean to check whether the user is in a Skillz game
- (void)addMetadata: (NSDictionary *)
forMatchInProgress: (BOOL)
Parameters
addMetadata
NSDictionary
of key/value pairs to update
forMatchInProgress
Boolean to check whether the user is in a Skillz game
void addMetadataForMatchInProgress(java.util.Map<?,?> attributes, boolean isMatchInProgress)
Parameters
attributes
A Map
containing the metadata of the match in progress.
isMatchInProgress
A boolean indicating if a match is in progress.
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.
- Unity/C#
- iOS/Swift
- iOS/Objective-C
- Android/Java
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).
- Unity/C#
- iOS/Swift
- iOS/Objective-C
- Android/Java
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
- Unity/C#
- iOS/Swift
- iOS/Objective-C
- Android/Java
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
func tournamentWillBegin(
gameParameters: [AnyHashable : Any],
with matchInfo: SKZMatchInfo {}
Parameters
gameParameters
AnyHashable
contains the Game Parameters that were configured in the Skillz Developer Portal
matchInfo
SKZMatchInfo contains data relevant to the current match
- Required to implement
- Construction and loadout of gameplay is performed here
- (void)tournamentWillBegin:(NSDictionary *)gameParameters
withMatchInfo:(SKZMatchInfo *)matchInfo {}
Parameters
gameParameters
Dictionary contains the Game Parameters that were configured in the Skillz Developer Portal
matchInfo
SKZMatchInfo contains data relevant to the current match.
- Required to implement
- Construction and loadout of gameplay is performed here
<meta-data android:name="skillz_game_activity" android:value="" />
Parameters
android:value
Fully qualified path to gameplay activity
- Required to implement
On Progression Room Entry
Called when a user enters the Progression Room via Menu -> Progression Room or Progression Entry Point
- Unity/C#
- iOS/Swift
- iOS/Objective-C
- Android/Java
void OnProgressionRoomEnter() {}
- Required to implement, but can be left empty
- Construct and display the progression experience scene here
func onProgressionRoomEnter() {}
- Optional to implement
- Construct and display the progression experience here
- (void)onProgressionRoomEnter {}
- Optional to implement
- Construct and display the progression experience here
<meta-data android:name="skillz_progression_activity" android:value="" />
Parameters
android:value
Fully qualified path to progression activity
- Required to implement
- Leave value blank if not used or not yet known
On Skillz Exit
Called when a user exits the Skillz experience via Menu -> Exit
- Unity/C#
- iOS/Swift
- iOS/Objective-C
- Android/Java
void OnSkillzWillExit() {}
- Optional to implement
- Return to the game menu scene here
func skillzWillExit() {}
- Optional to implement
- Return to the game menu here
- (void)skillzWillExit {}
- Optional to implement
- Return to the game menu scene is performed here
<meta-data android:name="skillz_exit_activity" android:value="" />
Parameters
android:value
Fully qualified path to menu or title activity
- Required to implement
- Leave value blank if not used
On Skillz Finished Launching
Called once the Skillz UI has finished rendering
- Unity/C#
- iOS/Swift
- iOS/Objective-C
- Android/Java
func skillzHasFinishedLaunching() {}
- Optional to implement
- Use this to clean up the view hierarchy if needed
- (void)skillzHasFinishedLaunching {}
- Optional to implement
- Use this to clean up the view hierarchy if needed
On Skillz Will Launch
Called before the Skillz UI launches
- Unity/C#
- iOS/Swift
- iOS/Objective-C
- Android/Java
func skillzWillLaunch() {}
- Optional to implement
- Use this to clean up states before Skillz launches if needed
- (void)skillzWillLaunch {}
- Optional to implement
- Use this to clean up states before Skillz launches
Objects
Real-Time Server Connection Info
- Unity/C#
- iOS/Swift
- iOS/Objective-C
- Android/Java
CustomServerConnectionInfo
Property | Data Type | Description |
---|---|---|
isBotMatch | bool | Indicates if the match is a sync bot match |
MatchId | string | The ID of the real-time match |
MatchToken | string | An encrypted token to help validate the session server side |
ServerIp | string | The hostname or IP for the match |
ServerPort | string | The port for the game server |
SKZSyncConnectionInfo
Property | Data Type | Description |
---|---|---|
isBotMatch | BOOL | Indicates if the match is a sync bot match |
MatchId | NSString | The ID of the real-time match |
MatchToken | NSString | An encrypted token to help validate the session server side |
ServerIp | NSString | The hostname or IP for the match |
ServerPort | NSString | The port for the game server |
SKZSyncConnectionInfo
Property | Data Type | Description |
---|---|---|
isBotMatch | BOOL | Indicates if the match is a sync bot match |
MatchId | NSString | The ID of the real-time match |
MatchToken | NSString | An encrypted token to help validate the session server side |
ServerIp | NSString | The hostname or IP for the match |
ServerPort | NSString | The port for the game server |
SyncConnectionInfo
Property | Data Type | Description |
---|---|---|
isBotMatch | boolean | Indicates if the match is a sync bot match |
MatchId | String | The ID of the real-time match |
MatchToken | String | An encrypted token to validate the session server-side |
ServerIp | String | The hostname or IP for the match |
ServerPort | String | The port for the game server |
Match Info
- Unity/C#
- iOS/Swift
- iOS/Objective-C
- Android/Java
Match
Property | Data Type | Description |
---|---|---|
BracketRound | int? | Indicates the round of the bracket tournament if IsBracket is true |
CustomServerConnectionInfo | CustomServerConnectionInfo | The connection info to a custom server that coordinates a real-time match |
Description | string | The description of this tournament type |
EntryCash | float? | If this tournament is being played for real cash, this is the amount of cash required to enter |
EntryPoints | int? | If this tournament is being played for Z, this is the amount of Z required to enter. |
GameParams | Dictionary<string, string> | The custom parameters for this tournament type specified in the developer portal |
ID | ulong? | The unique ID for the match |
IsBracket | bool | Indicates the match is a bracketed tournament |
IsCash | bool? | Indicates the match is for real prizes or for Z |
IsCustomSynchronousMatch | bool | Indicates if the match is a sync match |
IsSynchronous | bool | Deprecated. Indicates if this match is Sync. Note: please use the IsCustomSynchronousMatch property |
IsTieBreaker | bool | Indicates whether the match is a tie-breaker |
IsVideoAdEntry | bool? | Indicates the match entry was through a video ad |
Name | string | Name of the match |
Players | List<Player> | List of players in the match |
SkillzDifficulty | uint? | The difficulty of the game (used with automatic difficulty). Note: only set in production. |
TemplateID | int? | The unique ID for the tournament template this match is based on |
SKZMatchInfo
Property | Data Type | Description |
---|---|---|
BracketRound | NSNumber | Indicates the round of the bracket tournament if IsBracket is true |
ConnectionInfo | SKZSyncConnectionInfo | The connection info to a Skillz server that coordinates a real-time match. |
Name | NSString | Match name as configured in the Skillz Developer Portal |
EntryCash | NSNumber | Cash entry fee, nil if there is none |
EntryPoints | NSNumber | Z points entry fee, nil if there is none |
ID | NSInteger | The unique ID for the match |
IsBracket | BOOL | Indicates the match is a bracketed tournament |
IsCash | BOOL | Flag indicating cash match |
IsSynchronous | BOOL | Match to be played is a synchronous match, and should use the synchronous game flow |
IsTieBreaker | BOOL | Indicates whether the match is a tie-breaker |
IsVideoAdEntry | BOOL | Indicates the match entry was through a video ad |
MatchDescription | NSString | Match description as configured in the Skillz Developer Portal |
Players | NSArray<SKZPlayer> | Array of SKZPlayers in the match |
TemplateID | NSNumber | The unique ID for the tournament template this match is based on |
SKZMatchInfo
Property | Data Type | Description |
---|---|---|
BracketRound | NSNumber | Indicates the round of the bracket tournament if IsBracket is true |
ConnectionInfo | SKZSyncConnectionInfo | The connection info to a Skillz server that coordinates a real-time match. |
Name | NSString | Match name as configured in the Skillz Developer Portal |
EntryCash | NSNumber | Cash entry fee, nil if there is none |
EntryPoints | NSNumber | Z points entry fee, nil if there is none |
ID | NSInteger | The unique ID for the match |
IsBracket | BOOL | Indicates the match is a bracketed tournament |
IsCash | BOOL | Flag indicating cash match |
IsSynchronous | BOOL | Match to be played is a synchronous match, and should use the synchronous game flow |
IsTieBreaker | BOOL | Indicates whether the match is a tie-breaker |
IsVideoAdEntry | BOOL | Indicates the match entry was through a video ad |
MatchDescription | NSString | Match description as configured in the Skillz Developer Portal |
Players | NSArray<SKZPlayer> | Array of SKZPlayers in the match |
TemplateID | NSNumber | The unique ID for the tournament template this match is based on |
MatchInfo
Property | Data Type | Description |
---|---|---|
BracketRound | int | Indicates the round of the bracket tournament if IsBracket is true |
ConnectionInfo | SyncConnectionInfo | The connection info to a Skillz server that coordinates a real-time match. |
ConnectToken | String | |
Name | String | Name of the match |
EntryCash | float | If this tournament is being played for real cash, this is the amount of cash required to enter. |
EntryPoints | int | If this tournament is being played for Z, this is the amount of Z required to enter. |
ID | String | The unique ID for the match |
IsBracket | boolean | Indicates the match is a bracketed tournament |
IsCash | boolean | Indicates the match is for real prizes or for Z |
IsCustomServerSync | boolean | Indicates if the match is a custom server sync match |
IsSkillzServerSync | boolean | Indicates if the match is a Skillz server sync match |
IsSyncBotMatch | boolean | Indicates if the match is a sync bot match |
IsSynchronous | boolean | Indicates if this is a sync match |
IsTieBreaker | boolean | Indicates whether the match is a tie-breaker |
IsVideoAdEntry | boolean | Indicates the match entry was through a video ad |
MatchDescription | String | The description of this tournament type |
Players | List<SkillzPlayer> | List of players in the match |
SkillzDifficulty | String | The difficulty of the game (used with automatic difficulty). Note: only set in production. |
TemplateID | String | The unique ID for the tournament template this match is based on |
Player Info
- Unity/C#
- iOS/Swift
- iOS/Objective-C
- Android/Java
Player
Property | Data Type | Description |
---|---|---|
AvatarURL | string | A link to the user's avatar image |
DisplayName | string | Player name |
FlagURL | string | A link to the user's country's flag image |
ID | ulong? | The ID unique to this user |
IsCurrentPlayer | bool | This Player represents the current user if this is true |
TournamentPlayerID | ulong? | A Tournament Player ID unique to this user |
SKZPlayer
Property | Data Type | Description |
---|---|---|
AvatarURL | NSString | Player's profile picture URL |
DisplayName | NSString | Player's display name |
FlagURL | NSString | URL for the flag of the player |
ID | NSString | Player's unique ID |
isCurrentPlayer | bool | Flag for if the player is the current player |
PlayerMatchID | NSString | Player's ID for the match |
SKZPlayer
Property | Data Type | Description |
---|---|---|
AvatarURL | NSString | Player's profile picture URL |
DisplayName | NSString | Player's display name |
FlagURL | NSString | URL for the flag of the player |
ID | NSString | Player's unique ID |
isCurrentPlayer | bool | Flag for if the player is the current player |
PlayerMatchID | NSString | Player's ID for the match |
Player
Property | Data Type | Description |
---|---|---|
AvailableThumbnailURL | String | Returns ThumbnailURL or falls back to AvatarURL |
AvatarURL | String | A link to the user's avatar image |
BestScore | double | User's best score |
CashPrize | double | |
EntryID | String | |
FlagURL | String | A link to the user's country's flag image |
ID | String | |
isAborted | boolean | |
isFinished | boolean | |
isPending | boolean | |
isStarted | boolean | |
isTie | boolean | |
isWinner | boolean | |
MatchID | String | Match ID |
Name | String | User Name |
Outcome | String | |
Position | int | |
ReplayURL | String | |
Score | double | User score |
Shoutout | String | |
State | String | |
TicketzPrize | long | |
ThumbnailURL | String | |
UserID | String | The unique ID for this user |
ZPrize | long |
Progression Metadata
- Unity/C#
- iOS/Swift
- iOS/Objective-C
- Android/Java
ProgressionMetadata
Property | Data Type | Description |
---|---|---|
GameIds | List<string> | List of relevant game IDs for the associated ProgressionValue |
ProgressionMetadata
Property | Data Type | Description |
---|---|---|
GameIds | List<String> | List of relevant game IDs for the associated ProgressionValue |
Progression Value
- Unity/C#
- iOS/Swift
- iOS/Objective-C
- Android/Java
ProgressionValue
Property | Data Type | Description |
---|---|---|
DataType | string | The data type for the stored value |
DisplayName | string | The display name for the stored value |
LastUpdatedTime | DateTime | The timestamp of when the data was last updated on Skillz servers in UTC |
Metadata | ProgressionMetadata | The metadata for this progression value |
Value | string | The stored value for this progression value |
ProgressionValue
Property | Data Type | Description |
---|---|---|
DateCached | Date | The datetime of when the data was last cached |
DateUpdated | Date | The datetime of when the data was last updated on Skillz servers in UTC |
DisplayName | string | The display name for the stored value |
Meta | ProgressionMetadata | The metadata for this progression value |
Value | string | The stored value for this progression value |
ValueType | string | The data type for the stored value |
Skillz Player Info
- Unity/C#
- iOS/Swift
- iOS/Objective-C
- Android/Java
Does not exist in Unity. Use Player Info
Does not exist in Swift. Use Player Info
Does not exist in Objective-C. Use Player Info
SkillzPlayer
Property | Data Type | Description |
---|---|---|
AvatarUrl | String | A link to the user's avatar image |
FlagUrl | String | A link to the user's country's flag image |
isCurrentPlayer | boolean | This SkillzPlayer represents the current user if this is true |
PlayerMatchId | String | A Tournament Player ID unique to this user |
UserId | String | The unique ID for this user |
UserName | String | The displayed player name |