Iakobs / godot-play-game-services

A Godot 4.x plugin for integration with Google Play Game Services
MIT License
120 stars 7 forks source link

Sign Out feature #28

Closed Isaias-F closed 5 months ago

Isaias-F commented 5 months ago

Hi!

I've been migrating to the new version of Godot (4.2), and I noticed that there's not a Sign Out feature. I think it would be great if you could add this method and so, some players could have the option to change their Play Games account.

Iakobs commented 5 months ago

Hi @Isaias-F thanks a lot for your interest in the plugin, I hope you find it useful!

About logging out, I'm afraid there's no option for that provided from Google. If the player wants to change the user, they have to do it manually from the Play Games app itself.

Isaias-F commented 5 months ago

Hi again!

I think I found a method, I don't know if it can really help you but apparently there's a method to log out:

Google developers

(At the end of the page)

I don't know so much about Kotlin but, I think the code could be something like this:

fun signOut() {
        gamesSignInClient.signOut().addOnCompleteListener { task ->
            if (task.isSuccessful) {
                // Signal
            } else {
                // Signal
            }
        }
}
Iakobs commented 5 months ago

Hey! Thanks for the research and code example! That's the old and deprecated version of the Google library, though. The plugin uses the new version, and Google removed the sign out functionality from it. Who knows why 🙄

Isaias-F commented 5 months ago

Oh really?

It's really strange, I'm migrating from 4.1 and I used another plugin that still allows me to log out (I guess it's because it uses the old version)

Oh well, time to make small changes, thanks for everything! 😉 And great plugin. I'll use it.