Abedalkareem / games_services

A Flutter plugin to support game center and google play games services.
118 stars 48 forks source link

Web support #128

Open erperejildo opened 9 months ago

erperejildo commented 9 months ago

Is this possible? If so, any plans to add it in the future?

theLee3 commented 9 months ago

This is not possible as there is no access to the Play Games or Game Center SDKs via web.

Abedalkareem commented 9 months ago

I think for web we can use Google play game services Rest API, or any other wildly used service if there is any. I'll do some research and see, and if someone knows a good one that will be good.

erperejildo commented 9 months ago

I think for web we can use Google play game services Rest API, or any other wildly used service if there is any. I'll do some research and see, and if someone knows a good one that will be good.

Maybe this helps https://github.com/google/googleapis.dart/issues/583?notification_referrer_id=NT_kwDOAFXn37I4NTYzMjIxNjQ1OjU2Mjk5MTk

theLee3 commented 9 months ago

According to the docs, the REST API is intended for server side access for an Android client.

That is not to say that a solution couldn't possibly be built around it, using the API & GoogleSignIn but it may violate the TOS. Plus, it would only be available for Google Play Games users, which could be a downside.

I would suggest people wanting web game achievements use a backend like nakama or roll a leaderboard/achievement system with Firebase or a similar service. Then you can allow sign in with various auth providers, with no risk of alienating an audience.

erperejildo commented 9 months ago

According to the docs, the REST API is intended for server side access for an Android client.

That is not to say that a solution couldn't possibly be built around it, using the API & GoogleSignIn but it may violate the TOS. Plus, it would only be available for Google Play Games users, which could be a downside.

I would suggest people wanting web game achievements use a backend like nakama or roll a leaderboard/achievement system with Firebase or a similar service. Then you can allow sign in with various auth providers, with no risk of alienating an audience.

As they mentioned, Google Play Games is also available now for PC. Why would it violate the TOS?

theLee3 commented 9 months ago

Google Play Games on PC is uses virtualization to play Android Games on PC via some degree of Android emulation. It was implemented to compete with macOS's ability to play iOS games (only available on Apple silicon). You are still playing an Android game with access to the Android Play Games SDK if implemented.

Not quite the same as building for a different platform altogether and trying to integrate it. I don't know for sure that it does violate the TOS, but it certainly isn't within their intended scope of the service.

It may not even be isn't possible (see below) given that Play Games Services is tied so closely to the Play Store. PGS management occurs through the Play Store, including client app credentials. In fact, the docs state that the use of the Play Games Services SDK is still required. You must login through it, then request a server auth code, which is then used to allow your server to act as an intermediary between the client app and PGS.

A user cannot authenticate with PGS without the SDK. This is required to acquire a server auth code that your backend can then use to make API calls.

UPDATE: After digging around, it is incorrect to say that Google Play Games support on the web is not possible. However, it still requires the implementation of server side calls to PGS. Therefore, I do believe it is outside of the scope of this package.