playgameservices / play-games-plugin-for-unity

Google Play Games plugin for Unity
Other
3.47k stars 966 forks source link

SignIn action always return FALSE but next frame return TRUE #1320

Open antoniojesusnc opened 8 years ago

antoniojesusnc commented 8 years ago

Hi, I'm doing the SignIn and use one method as action. The result is always fail ( false ), and if I check "Social.localUser.authenticated" is false also. Then, I wait one frame and check again "Social.localUser.authenticated" and now the return is true. Why is this happening? Could be the order on the listeners? For now I delay the check one frame, but I don't like this solution.

This is how I'm doing the Init and sign in request ` public void signIn(){ PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder() // enable saved games .EnableSavedGames() // Build .Build(); PlayGamesPlatform.InitializeInstance(config); PlayGamesPlatform.Activate();

Social.localUser.Authenticate(signInResponse); }

private void signInResponse(bool success){ `

claywilkinson commented 8 years ago

Can you share a log of authentication? It could be possible that the callback is not on the main thread, but some state might be set on the main thread causing this behavior?