2

In native iOS, to authenticate a GameCenter player we call this just once:

GKLocalPlayer.LocalPlayer.AuthenticateHandler = delegate (UIViewController authenticationViewController, NSError error) // error is just to assist with debugging, eg error 5019 is no leaderboard setup in App Store Connect
{
    // This is called multiple times: 
    // whenever app App is Foregrounded and Game Center player may have changed name or logged in or out
}

which all works fine.

However, in Unity I am calling this just once:

Social.localUser.Authenticate((bool success) =>
{
    // This is only called once (eg with success=false if player is not logged in
});

But if I go to iPhone > Settings > Game Center and sign in then return to my game the callback is not called a second time.

So should Social.localUser.Authenticate be called every time the app is foregrounded?

Bbx
  • 3,184
  • 3
  • 22
  • 33

0 Answers0