class Achievements extends Resource (View source)

The "achievements" collection of methods.

Typical usage is:

 $gamesService = new Google\Service\Games(...);
 $achievements = $gamesService->achievements;

Methods

increment(string $achievementId, int $stepsToIncrement, array $optParams = [])

Increments the steps of the achievement with the given ID for the currently authenticated player. (achievements.increment)

listAchievements(string $playerId, array $optParams = [])

Lists the progress for all your application's achievements for the currently authenticated player. (achievements.listAchievements)

reveal(string $achievementId, array $optParams = [])

Sets the state of the achievement with the given ID to REVEALED for the currently authenticated player. (achievements.reveal)

setStepsAtLeast(string $achievementId, int $steps, array $optParams = [])

Sets the steps for the currently authenticated player towards unlocking an achievement. If the steps parameter is less than the current number of steps that the player already gained for the achievement, the achievement is not modified. (achievements.setStepsAtLeast)

unlock(string $achievementId, array $optParams = [])

Unlocks this achievement for the currently authenticated player.

updateMultiple(AchievementUpdateMultipleRequest $postBody, array $optParams = [])

Updates multiple achievements for the currently authenticated player.

Details

AchievementIncrementResponse increment(string $achievementId, int $stepsToIncrement, array $optParams = [])

Increments the steps of the achievement with the given ID for the currently authenticated player. (achievements.increment)

Parameters

string $achievementId

The ID of the achievement used by this method.

int $stepsToIncrement

Required. The number of steps to increment.

array $optParams

Optional parameters.

Return Value

AchievementIncrementResponse

Exceptions

Exception

PlayerAchievementListResponse listAchievements(string $playerId, array $optParams = [])

Lists the progress for all your application's achievements for the currently authenticated player. (achievements.listAchievements)

Parameters

string $playerId

A player ID. A value of me may be used in place of the authenticated player's ID.

array $optParams

Optional parameters.

Return Value

PlayerAchievementListResponse

Exceptions

Exception

AchievementRevealResponse reveal(string $achievementId, array $optParams = [])

Sets the state of the achievement with the given ID to REVEALED for the currently authenticated player. (achievements.reveal)

Parameters

string $achievementId

The ID of the achievement used by this method.

array $optParams

Optional parameters.

Return Value

AchievementRevealResponse

Exceptions

Exception

AchievementSetStepsAtLeastResponse setStepsAtLeast(string $achievementId, int $steps, array $optParams = [])

Sets the steps for the currently authenticated player towards unlocking an achievement. If the steps parameter is less than the current number of steps that the player already gained for the achievement, the achievement is not modified. (achievements.setStepsAtLeast)

Parameters

string $achievementId

The ID of the achievement used by this method.

int $steps

Required. The minimum value to set the steps to.

array $optParams

Optional parameters.

Return Value

AchievementSetStepsAtLeastResponse

Exceptions

Exception

AchievementUnlockResponse unlock(string $achievementId, array $optParams = [])

Unlocks this achievement for the currently authenticated player.

(achievements.unlock)

Parameters

string $achievementId

The ID of the achievement used by this method.

array $optParams

Optional parameters.

Return Value

AchievementUnlockResponse

Exceptions

Exception

AchievementUpdateMultipleResponse updateMultiple(AchievementUpdateMultipleRequest $postBody, array $optParams = [])

Updates multiple achievements for the currently authenticated player.

(achievements.updateMultiple)

Parameters

AchievementUpdateMultipleRequest $postBody
array $optParams

Optional parameters.

Return Value

AchievementUpdateMultipleResponse

Exceptions

Exception