Skip to content

[codex] Show Android achievement completion banners - #238

Closed
JoelFerrando wants to merge 2 commits into
Abedalkareem:developfrom
JoelFerrando:codex/android-achievement-banners
Closed

[codex] Show Android achievement completion banners#238
JoelFerrando wants to merge 2 commits into
Abedalkareem:developfrom
JoelFerrando:codex/android-achievement-banners

Conversation

@JoelFerrando

@JoelFerrando JoelFerrando commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

What changed

  • Android now reads Achievement.showsCompletionBanner from the unlock method channel call.
  • When the flag is true, Android invokes Play Games unlock(...) so Google Play Games can show its native achievement completion banner.
  • Android still invokes unlockImmediate(...) afterward so the Dart Future keeps the existing success/error behavior.
  • Updated public docs and API comments so showsCompletionBanner is no longer documented as iOS-only.

Why

The Dart/platform-interface layer already sends showsCompletionBanner, and iOS/macOS already honor it. Android dropped the argument and only used unlockImmediate(...), which can confirm the unlock result but does not trigger the native Play Games completion UI. Apps that rely on the native banner therefore need a custom Android bridge today.

Compatibility

This does not add a new public API. It keeps the existing default of showsCompletionBanner: true, preserves the existing Future success/error contract through unlockImmediate(...), and only changes Android so it respects the flag that Dart already sends.

Validation

  • dart format games_services/lib/src/achievements.dart games_services/lib/src/games_services.dart games_services_platform_interface/lib/src/models/achievement.dart
  • flutter analyze --no-fatal-warnings in games_services (only the repo's existing local path dependency warning is reported)
  • dart analyze in games_services_platform_interface
  • flutter build apk --debug in games_services/example

@theLee3

theLee3 commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Thanks for your contribution @JoelFerrando.

unlockImmediate should show a banner just like unlock does. I have just confirmed this behavior using the current release of the plugin, so it seems that something else must be going on.

Can you share a little more about your usage?

  1. Device/emulator?
  2. Android version & Google Play Services version?
  3. Are you utilizing auto sign-in on Android, or have you followed the steps to disable and implement manual sign-in?
  4. Any other pertinent information?

@JoelFerrando

JoelFerrando commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

Thanks — you were right. We made the wrong assumption here: we treated an API/code review and a successful build as if they proved the missing-banner behavior, but we had not reproduced that behavior reliably on a physical device. unlockImmediate does show the completion banner, as you confirmed.

That also means this implementation is wrong. It calls both unlock and unlockImmediate, creating a duplicate write, and it still cannot honor showsCompletionBanner: false on Android because the immediate call always runs.

For reference, the physical environment now available to us is a V2310 running Android 15 (API 35), Google Play services 26.26.34, and the Play Games app 2025.09.66390. Logivibe disables PlayGamesInitProvider, initializes PlayGamesSdk explicitly, and uses manual sign-in. I still cannot reproduce the original missing-banner observation reliably in that environment, so I am closing this rather than asking you to review a fix for an unproven problem.

I also accidentally mixed an unrelated leaderboard error-classification commit into this branch. I have split that work into focused proposals that use native status codes instead of localized-message parsing and do not treat GKError.cancelled as a consent error.

Thanks for checking the behavior and catching this.

@JoelFerrando

JoelFerrando commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

I have split the useful parts into two focused drafts:

  • fix: expose actionable leaderboard score errors #244 maps leaderboard failures from native status codes and exposes stable Dart constants. Android now has unit coverage for sign-in-required, developer-error, and generic failures, plus a physical-device check. The GameKit compile and the friends-consent flow are still explicitly pending.
  • feat(android): support setting achievement steps #245 exposes the genuinely missing Android setStepsImmediate operation so apps can reconcile absolute achievement progress without a custom Kotlin channel. Its Dart validation and channel contract have four automated tests, and the full Dart → MethodChannel → Kotlin error path has run on a physical device. An authenticated success still needs a Play Games-registered build.

I am keeping both as drafts until those remaining platform-specific checks are either completed or agreed with the maintainer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants