3

I have a problem with logging a user to the Game Center. I first present the login dialog right after the application finishes loading. If the user cancels the dialog. the button doesn't do anything - the Game Center dialog doesn't get shown.I immediately get the error

error Code:-

_authenticateUsingAlert: Failed to authenticate player with existing credentials.Error: Error Domain=GKErrorDomain Code=6 "The requested operation could not be completed because the local player has not been authenticated." UserInfo={NSLocalizedDescription=The requested operation could not be completed because the local player has not been authenticated

Social.localUser.Authenticate(success => {
            if (success)
                Debug.Log("success authenticate");
            else
                Debug.Log("Failed to authenticate");
        });
FreakyAli
  • 13,349
  • 3
  • 23
  • 63
Jayprakash Singh
  • 1,343
  • 3
  • 15
  • 28

1 Answers1

0

Here is answer for your question: https://stackoverflow.com/a/21132075

Important: Game Kit handles opting out of Game Center across all games that support Game Center. If a player has already declined to create an account, when your game authenticates the player, it is told there is no authenticated player. The player never sees an authentication dialog. Because Game Kit handles this process across all games, your game should not include its own mechanism to disable Game Center authentication or ask a player’s permission to authenticate. Instead, your game should simply authenticate the player every time it launches and respond appropriately when authentication completes.

BoJIHa npocmombI
  • 195
  • 1
  • 7
  • 22