API Reference
Core Loop​
Launch Skillz UI​
- Unity/C#
- iOS/Swift
- iOS/Objective-C
- Android/Java
This method is overloaded
- Asynchronous
- Synchronous
void SkillzCrossPlatform.LaunchSkillz();
Legacy:
void SkillzCrossPlatform.LaunchSkillz(SkillzMatchDelegate matchDelegate);
Parameters​
Legacy: matchDelegate
A reference to a SkillzMatchDelegate instance that Skillz will use
void SkillzCrossPlatform.LaunchSkillz();
Legacy:
void SkillzCrossPlatform.LaunchSkillz(SkillzMatchDelegate matchDelegate);
Parameters​
Legacy: matchDelegate
A reference to a SkillzMatchDelegate 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
This method is overloaded
- 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
This method is overloaded
- 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
This method is overloaded
- 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
This method is overloaded
- 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()
This method is overloaded
- 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
This method is overloaded
- 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
This method is overloaded
- 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