API reference
API reference
Select your platform
No SDKs available
No versions available

Leaderboards Class

Modifiers: final
The Leaderboards API provides a way to manage and interact with leaderboards in your application. The API allows you to retrieve information about a single leaderboard, write entries to a leaderboard, and retrieve blocks of leaderboard entries based on different criterias. Leaderboard-integrated apps get Challenges for free, accessible through the Scoreboards UI. Visit our website for more information about leaderboards.

Signature

class Leaderboards

Constructors

Leaderboards ()
Signature
constructor()
Returns
Leaderboards

Functions

get ( coroutineScope , leaderboardName )
Retrieves detailed information for a single leaderboard with a specified name, returning an array of Leaderboard.
Signature
fun get(coroutineScope: CoroutineScope, leaderboardName: String): PagedResults<Leaderboard>
Parameters
coroutineScope: CoroutineScope
leaderboardName: String
Returns
PagedResults
A list of Leaderboard objects.
getEntries ( coroutineScope , leaderboardName , limit , filter , startAt )
Retrieves a list of leaderboard entries for a specified leaderboardName, with options to filter and limit the number of results returned.
Signature
fun getEntries(coroutineScope: CoroutineScope, leaderboardName: String, limit: Int, filter: LeaderboardFilterType, startAt: LeaderboardStartAt): PagedResults<LeaderboardEntry>
Parameters
coroutineScope: CoroutineScope
leaderboardName: String
limit: Int
Specifies the maximum number of entries to be returned.
filter: LeaderboardFilterType
By using ovrLeaderboard_FilterFriends, this allows you to filter the returned values to bidirectional followers.
startAt: LeaderboardStartAt
Returns
PagedResults
A list of LeaderboardEntry objects.
getEntriesAfterRank ( coroutineScope , leaderboardName , limit , afterRank )
Retrieves a block of leaderboard entries starting from a specific rank.
Signature
fun getEntriesAfterRank(coroutineScope: CoroutineScope, leaderboardName: String, limit: Int, afterRank: Long): PagedResults<LeaderboardEntry>
Parameters
coroutineScope: CoroutineScope
leaderboardName: String
limit: Int
The maximum number of entries to return.
afterRank: Long
Returns
PagedResults
A list of LeaderboardEntry objects after the specified rank.
getEntriesByIds ( coroutineScope , leaderboardName , limit , startAt , userIds )
Retrieves a block of leaderboard entries that match the specified user IDs. Only entries corresponding to the provided user IDs will be returned.
Signature
fun getEntriesByIds(coroutineScope: CoroutineScope, leaderboardName: String, limit: Int, startAt: LeaderboardStartAt, userIds: List<String>): PagedResults<LeaderboardEntry>
Parameters
coroutineScope: CoroutineScope
leaderboardName: String
limit: Int
The maximum number of entries to return.
startAt: LeaderboardStartAt
userIds: List
Returns
PagedResults
A list of LeaderboardEntry objects.
writeEntry ( leaderboardName , score , extraData , forceUpdate )
Writes a single entry to the leaderboard, returning LeaderboardUpdateStatus indicating whether the update was successful and providing the updated challenge IDs.
Signature
suspend fun writeEntry(leaderboardName: String, score: Long, extraData: ByteArray? = null, forceUpdate: Boolean? = null): LeaderboardUpdateStatus
Parameters
leaderboardName: String
score: Long
The score to be written in the leaderboard.
extraData: ByteArray?
forceUpdate: Boolean?
Returns
LeaderboardUpdateStatus
The status of the leaderboard update.
writeEntryWithSupplementaryMetric ( leaderboardName , score , supplementaryMetric , extraData , forceUpdate )
Writes a single entry to a leaderboard which can include supplementary metrics, returning LeaderboardUpdateStatus indicating whether the update was successful and providing the updated challenge IDs.
Signature
suspend fun writeEntryWithSupplementaryMetric(leaderboardName: String, score: Long, supplementaryMetric: Long, extraData: ByteArray? = null, forceUpdate: Boolean? = null): LeaderboardUpdateStatus
Parameters
leaderboardName: String
score: Long
The score to be written in the leaderboard.
supplementaryMetric: Long
extraData: ByteArray?
forceUpdate: Boolean?
Returns
LeaderboardUpdateStatus
The status of the leaderboard update.
Did you find this page helpful?