-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add player stream #182
base: develop
Are you sure you want to change the base?
Add player stream #182
Conversation
Consolidate `PlayerData` class to avoid redundancies. Fix auth issues for subsequent `SignIn` calls. Fix false positives for `isSignedIn`. Remove redundant channel methods for info accessible via `PlayerData` class & player stream.
Also working on an updated written tutorial to link to. I will push to this PR tonight or tomorrow. |
@Abedalkareem This PR still does not set the GameKit auth handler until The difference being that on iOS, This would adhere to Apple's guidelines, but would eliminate the ability for devs to defer sign-in to a later point in the app lifecycle (a possibility that no longer exists on Android either). |
3221d98
to
aea47f8
Compare
523348c
to
b9b63f8
Compare
This update adds the getter
Stream<PlayerData?> player
toGameAuth
, making it far easier to update the UI on auth changes.Issues related to
signIn
are also resolved, in particular, the hanging ofsignIn
on iOS due to setting theauthenticationHandler
on everysignIn
call. Per the docs, this should be set one time. Afterwards an error is thrown so the dev can direct the user to sign in via Game Center in the device settings.On Android, if Play Services is missing or outdated on the device,
signIn
will no longer hang until the user taps the notification from Play Services. Many users did not notice this notification and perceived the app as frozen. Now the plugin will throw an error from thesignIn
method and, if possible, present a native dialog allowing the user to easily install or update Play Services on the device.PlayerData
now includes all player related data for easy synchronous access from the stream.Some code has been refactored to utilize the data from stream to prevent redundant platform channel communications to optimize performance. All changes are fully backwards compatible.
Docs & changelog are updated accordingly, and version number is bumped to 4.1.0.