feat(android): support setting achievement steps - #245
Open
JoelFerrando wants to merge 2 commits into
Open
Conversation
JoelFerrando
marked this pull request as ready for review
July 27, 2026 19:11
Author
|
I was able to finish the missing authenticated device test. Starting from |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Achievements.setStepsand the backwards-compatibleGamesServices.setStepsfacadesetStepsImmediatesteps > 0before crossing the channelfailed_to_set_achievement_stepsnative errorWhy
incrementis not safe for reconciliation or retryable sync: replaying a delta can over-count progress. Google Play Games exposessetStepsImmediatespecifically to set an incremental achievement to at least an absolute number of completed steps. If the stored progress is already higher, the call is a no-op.Exposing that API lets Flutter apps perform idempotent achievement reconciliation without maintaining an app-specific Kotlin method channel. The implementation keeps the package's existing immediate/Future mutation behavior and success return contract.
This is intentionally Android-only. Calls on other platforms fail in Dart before invoking the native channel, so no GameKit behavior is changed.
API reference: https://developers.google.com/android/reference/com/google/android/gms/games/AchievementsClient#setStepsImmediate(java.lang.String,int)
Verification
4/10setSteps(1)returnedSuccessand a forced reload remained4/10, proving progress is not reducedsetSteps(5)returnedSuccessand a forced reload returned5/10, proving a real server-side mutationfailed_to_set_achievement_stepscode, covering the native failure pathdart analyzeingames_services_platform_interface: cleanflutter analyze --no-fatal-warningsingames_services: only the existing developmentpathdependency warningNo Apple hardware or GameKit verification is required for this PR because the operation is Android-only and the Dart layer rejects other platforms before the native channel.