Skip to main content

games_services_watchos 0.2.1 copy "games_services_watchos: ^0.2.1" to clipboard
games_services_watchos: ^0.2.1 copied to clipboard

watchOS implementation of the games_services plugin: Game Center leaderboards over GameKit, bridged with dart:ffi.

0.2.1 #

  • Example: games_services' own example app, unchanged, with its logo and its MIT licence (example/LICENSE), replaces a hand-written demo and its layout test (AUTHORING.md §3). The integration test is now watchos_games_services_test.dart.

0.2.0 #

  • Implements games_services_platform_interface 5.3.0 (^5.3.0, was ^4.1.1), so it works with games_services 5.x. The README's install snippet names games_services: ^5.3.0; an app that stays on games_services 4.x keeps 0.1.0. The example and the dev dependency name games_services: ^5.3.0 too.
  • Breaking: signIn and submitScore answer as games_services 5.x does on iOS, so app code reads them the same on the wrist as on the phone. signIn completes with "Player authenticated successfully" when it signs the player in, and with "Player already authenticated" when the player already was; submitScore completes with "Success". A failure is a PlatformException: failed_to_authenticate, or sign_in_unavailable when GameKit has already answered this launch's sign-in and the player is not signed in (the plugin asks once per launch), and failed_to_send_score; as on iOS, the message is in details too. Version 0.1.0 completed both with null on success and with the error message on failure, so code that reads null as success has to change.
  • A sign-in waits at most 20 seconds for GameKit's answer, and then fails with failed_to_authenticate and a message that says so. submitScore never fails with iOS's leaderboard_not_found: the watch submits without loading the leaderboard first, so that case arrives as failed_to_send_score. The README lists both, with the wait for a sign-in already in flight.
  • Bindings: authState reads the sign-in state in one native call, as a new GcAuthState (unavailable, idle, pending, signedIn, failed). available, authenticated and the new signInFailed (true for failed) derive from it. signIn takes both of its decisions from one read, so an attempt that fails while the call starts cannot turn failed_to_authenticate into sign_in_unavailable. The plugin reads authState, so a test fake overrides it rather than authenticated.
  • player is implemented, so GameAuth.isSignedIn, GameAuth.player and the getters of Player (getPlayerName, getPlayerID, ...) work on the watch. In 0.1.0 player threw UnimplementedError, so GameAuth.isSignedIn failed. Each subscriber gets the live sign-in state first; after that, a change reaches subscribers when one of the plugin's calls finds it, because the native side pushes nothing. The PlayerData has GameKit's alias as its displayName; playerID, teamPlayerID, iconImage and the restriction flags are null. Every read returns the same stream, as on the other platforms. It reads the existing symbols, so the native code is unchanged.
  • README and PORTING_REPORT: submitScore, loadLeaderboardScores and getPlayerScore are marked ◐, with limits 0.1.0 had too but did not state. Reads are always of the global, all-time board from rank 1 (scope, timeScope and playerCentered are ignored, at most 100 rows), getPlayerScore finds the player only in the top 100 and is null otherwise (iOS answers 0 when there is no score), and Score.token is ignored.
  • loadLeaderboardScores and getPlayerScore take their leaderboard ids as String, as 5.3.0 declares them; 0.1.0 left them untyped. What they return is unchanged. The leaderboard JSON decodes with 5.3.0's LeaderboardScoreData.fromJson, the same decoder as 4.1.1's.
  • The members 5.x adds keep the interface's UnimplementedError: setSteps and showSavedGames (Android only), loadPreviousOccurrence and fetchIdentityVerificationSignature (not implemented yet). The README's "Not supported on watchOS" table and the PORTING_REPORT's interface list cover 5.3.0.
  • README: saved games fail because GKSavedGame does not exist on watchOS, not because they are not implemented yet.
  • Tests: a case for every public member of the 5.3.0 interface, each called with the parameters 5.3.0 gives it.
  • Example: signs in and submits as 5.x code does, catching PlatformException, and its integration test expects those failures on the Simulator.
  • Example: the list fills the screen and starts below the clock, at WatchStatusBar.heightOf (from flutter_watchos: ^0.1.0), with its other insets from MediaQuery; a status row shows the sign-in state from GameAuth.player. A widget test lays it out on three watch screens in both safe areas, and checks what it shows when a call fails and when the player signs in.

0.1.0 #

  • The version moves from 0.0.1 to 0.1.0, so that a ^0.1.0 constraint admits later fixes; ^0.0.1 admits none.
  • README: the install snippet names this version, and says to add this package alongside games_services.
  • pubspec.yaml: repository points at this package's folder in the plugins repo.
  • README: a "Not supported on watchOS" table; PORTING_REPORT: an "Interface coverage" list of every member of games_services_platform_interface 4.1.1, audited by hand.
  • README: the supported table lists only what works; the rest moves to the new table.
  • Dartdoc on every public member, and public_member_api_docs is on in analysis_options.yaml.
  • Example: pubspec.yaml names games_services: ^4.1.1 and games_services_platform_interface: ^4.1.1 instead of any.
  • README: says this release works with games_services 4.x, and that games_services 5.x, which needs the 5.x interface, does not resolve alongside it yet.
  • API docs and comments say "release" for handing native memory back.

0.0.1 #

  • Initial staged release: the watchOS implementation of games_services.
  • Leaderboards only — sign-in, score submission, and reading entries. Achievements, saved games and the access point keep the platform interface's UnimplementedError defaults; GKGameCenterViewController and GKAccessPoint do not exist on watchOS, so there is nothing to present and no partial version worth shipping.
  • Not yet verified end to end on a physical watch: GKLocalPlayer reports an authenticated player with an unresolved alias and GameKit then refuses loadEntries. See PORTING_REPORT.md.
0
likes
140
points
273
downloads

Documentation

API reference

Publisher

verified publisherflutterwatch.dev

Weekly Downloads

watchOS implementation of the games_services plugin: Game Center leaderboards over GameKit, bridged with dart:ffi.

Homepage
Repository (GitHub)
View/report issues

Topics

#watchos #ffi #games-services #game-center

License

BSD-3-Clause (license)

Dependencies

ffi, flutter, games_services_platform_interface

More

Packages that depend on games_services_watchos

Packages that implement games_services_watchos