- Home /
Authentication problem
private void Awake()
{
PlayGamesPlatform.DebugLogEnabled = true;
PlayGamesPlatform.Activate();
}
private void Start()
{
Social.localUser.Authenticate(success => Debug.Log(success));
var config =
new PlayGamesClientConfiguration.Builder().Build();
PlayGamesPlatform.InitializeInstance(config);
//PlayGamesPlatform.Instance.Authenticate(success => Debug.Log(success));
}
private void OnClick()
{
Social.ReportScore(12345, "CgkI9IGIn-kSEAIQCQ", success =>
{
// handle success or failure
});
PlayGamesPlatform.Instance.ShowLeaderboardUI("CgkI9IGIn-kSEAIQCQ");
}
}
}
ERROR: ReportScore can only be called after authentication.
ERROR: ShowLeaderboardUI can only be called after authentication.
Update1: It might be because of Soomla's integration, not sure, just an assumption, cause already saw a few posts having the same problem.
Update2: Linked question which may help you determine what I'm doing wrong.
What am I forgetting?
If you're not sure what could the problem be, please suggest actions which I can take in order to determine what the problem is on comments.
Check if authentication is successful, otherwise waitforxseconds and try again?
Okay, just one problem. I see neither true nor false from the authentication log, so which means that it doesn't even go in there.
Is PlayGamesPlatform set as the current Social.Active before Authenticating??
@FWCorey not exactly sure what you're asking me, could you rephrase the question please?
“Social.Active can be used to target a specific social platform implementation, but by default GameCenter is used on iOS. All other platforms default to the Local implementation which can be used for testing. See Social API Reference $$anonymous$$anual for an overview.” from the docs for the Social class.
You may need to wait until after PlaygamesPlatform.InitializeInstance() to authenticate the user.