| Name | Summary |
|---|---|
Achievements | constructor() |
| Name | Summary |
|---|---|
Companion | object Companion |
| Name | Summary |
|---|---|
addCount | suspend fun addCount(name: String, count: Long): AchievementUpdate Add ‘count’ to the achievement with the given name. This must be a COUNT achievement. The largest number that is supported by this method is the max value of a signed 64-bit integer. If the number is larger than that, it is clamped to that max value before being passed to the servers. |
addFields | suspend fun addFields(name: String, fields: String): AchievementUpdate Unlock fields of a BITFIELD achievement. |
getAllDefinitions | fun getAllDefinitions(coroutineScope: CoroutineScope): PagedResults<AchievementDefinition> Retrieve all achievement definitions for the app, including their name, unlock requirements, and any additional details. |
getAllProgress | fun getAllProgress(coroutineScope: CoroutineScope): PagedResults<AchievementProgress> Retrieve the progress for the user on all achievements in the app. |
getDefinitionsByName | fun getDefinitionsByName(coroutineScope: CoroutineScope, names: List<String>): PagedResults<AchievementDefinition> Retrieve the achievement definitions that match the specified names, including their name, unlock requirements, and any additional details. |
getProgressByName | fun getProgressByName(coroutineScope: CoroutineScope, names: List<String>): PagedResults<AchievementProgress> Retrieve the user’s progress on the achievements that match the specified names. |
unlock | suspend fun unlock(name: String): AchievementUpdate Unlock the achievement with the given name. This can be of any achievement type: a simple unlock, count-based, or bitfield-based achievement. The Meta Quest Platform supports three types of achievements: simple, count and bitfield. Each achievement type has a different unlock mechanism. Simple achievements are all-or-nothing. They are unlocked by a single event or objective completion. For example, a simple achievement is unlocked when Frodo reaches Mount Doom. Count achievements are unlocked when a counter reaches a defined target. Define the horizon.platform.achievements.models.AchievementDefinition.target to reach that triggers the achievement. For example, a target achievement is unlocked when Darth Vader chokes 3 disappointing Imperial officers. Bitfield achievements are unlocked when a target number of bits in a bitfield are set. Define the horizon.platform.achievements.models.AchievementDefinition.target and horizon.platform.achievements.models.AchievementDefinition.bitfieldLength that triggers the achievement. For example, a bitfield achievement is unlocked when Harry destroys 5 of the 7 Horcruxes. |