games_services_watchos 0.2.1
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 nowwatchos_games_services_test.dart.
0.2.0 #
- Implements
games_services_platform_interface5.3.0 (^5.3.0, was^4.1.1), so it works withgames_services5.x. The README's install snippet namesgames_services: ^5.3.0; an app that stays ongames_services4.x keeps 0.1.0. The example and the dev dependency namegames_services: ^5.3.0too. - Breaking:
signInandsubmitScoreanswer asgames_services5.x does on iOS, so app code reads them the same on the wrist as on the phone.signIncompletes with "Player authenticated successfully" when it signs the player in, and with "Player already authenticated" when the player already was;submitScorecompletes with "Success". A failure is aPlatformException:failed_to_authenticate, orsign_in_unavailablewhen GameKit has already answered this launch's sign-in and the player is not signed in (the plugin asks once per launch), andfailed_to_send_score; as on iOS, the message is indetailstoo. 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_authenticateand a message that says so.submitScorenever fails with iOS'sleaderboard_not_found: the watch submits without loading the leaderboard first, so that case arrives asfailed_to_send_score. The README lists both, with the wait for a sign-in already in flight. - Bindings:
authStatereads the sign-in state in one native call, as a newGcAuthState(unavailable,idle,pending,signedIn,failed).available,authenticatedand the newsignInFailed(true forfailed) derive from it.signIntakes both of its decisions from one read, so an attempt that fails while the call starts cannot turnfailed_to_authenticateintosign_in_unavailable. The plugin readsauthState, so a test fake overrides it rather thanauthenticated. playeris implemented, soGameAuth.isSignedIn,GameAuth.playerand the getters ofPlayer(getPlayerName,getPlayerID, ...) work on the watch. In 0.1.0playerthrewUnimplementedError, soGameAuth.isSignedInfailed. 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. ThePlayerDatahas GameKit's alias as itsdisplayName;playerID,teamPlayerID,iconImageand 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,loadLeaderboardScoresandgetPlayerScoreare 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,timeScopeandplayerCenteredare ignored, at most 100 rows),getPlayerScorefinds the player only in the top 100 and is null otherwise (iOS answers 0 when there is no score), andScore.tokenis ignored. loadLeaderboardScoresandgetPlayerScoretake their leaderboard ids asString, 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'sLeaderboardScoreData.fromJson, the same decoder as 4.1.1's.- The members 5.x adds keep the interface's
UnimplementedError:setStepsandshowSavedGames(Android only),loadPreviousOccurrenceandfetchIdentityVerificationSignature(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
GKSavedGamedoes 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(fromflutter_watchos: ^0.1.0), with its other insets fromMediaQuery; a status row shows the sign-in state fromGameAuth.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.0constraint admits later fixes;^0.0.1admits none. - README: the install snippet names this version, and says to add this
package alongside
games_services. pubspec.yaml:repositorypoints 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_interface4.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_docsis on inanalysis_options.yaml. - Example:
pubspec.yamlnamesgames_services: ^4.1.1andgames_services_platform_interface: ^4.1.1instead ofany. - README: says this release works with
games_services4.x, and thatgames_services5.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
UnimplementedErrordefaults;GKGameCenterViewControllerandGKAccessPointdo 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:
GKLocalPlayerreports an authenticated player with an unresolved alias and GameKit then refusesloadEntries. See PORTING_REPORT.md.