2

I have Google Play Game Services implemented in my Unity game. Automatic user authentication(Sign In) takes place during the beginning of the game session. But if the user cancels the authentication process during the first time, then there would be no authentication related calls in the future game sessions. How do I find out if the user has canceled authentication?

And I am using the Unity plugin found here: https://github.com/playgameservices/play-games-plugin-for-unity

1
  • I believe the plugin allows you to authenticate through Unity's Social interface. So at the time of authentication, if it fails, you'll know not to make the authentication related calls (failure and cancellation can be seen as the same. You can check if the user is authenticated with ILocalUser.authenticated. Commented Aug 3, 2015 at 16:22

1 Answer 1

0

According to documentation of Authentication method in GooglePlayGames.PlayGamesPlatform:

    /// The callback to call when authentication finishes. It will be called
    /// with <c>true</c> if authentication was successful, <c>false</c>
    /// otherwise.

As you see, Authenticate method invokes your callback with a false parameter if authentication fails.

Sign up to request clarification or add additional context in comments.

3 Comments

Well, can i specifically find if user has cancelled during the sign in? Because I only want to stop the calls if the user denies. I don't want to stop for other reasons for the failure like network error or any other.
@GuardingMallet Use a boolean flag. Set it to true before auhentication and when you receive fail message, chek if flag is true or not. Then after all, check it to false again.
Problem with this method is that you can't tell if the authentication failed because the user canceled or if it failed due to connectivity or other issues.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.