Open FedeJure opened 1 year ago
Hi, I have the same problem, did you find a solution or a workaround?
@FedeJure @Linux1230
Did you guys try the PlayGamesPlatform.Instance.RequestServerSideAccess
after success from Authenticate?
Hi, I tried this, yesterday and now it works. I just don't commented here my solution.
public Task SignInAsync()
{
try
{
SetupAuthenticationEvents();
PlayGamesPlatform.Instance.Authenticate(RequestServerSideAccess);
}
catch (Exception e)
{
DebugManager.LogException(e);
AuthenticationErrorHandler.InvokeError(e.StackTrace);
}
return Task.CompletedTask;
}
private void RequestServerSideAccess(SignInStatus signInStatus)
{
if (!(signInStatus == SignInStatus.Success))
{
return;
}
else
{
AuthenticationErrorHandler.InvokeError($"Sign in status: {signInStatus}");
}
PlayGamesPlatform.Instance.RequestServerSideAccess(
false,
(string token) => GooglePlayGamesSignIn(token)
);
}
private async void GooglePlayGamesSignIn(string token)
{
try
{
await AuthenticationService.Instance.SignInWithGooglePlayGamesAsync(token);
}
catch (AuthenticationException ex)
{
AuthenticationErrorHandler.InvokeError(ex);
}
catch (RequestFailedException ex)
{
AuthenticationErrorHandler.InvokeError(ex);
}
catch (Exception ex)
{
AuthenticationErrorHandler.InvokeError(ex);
}
}
Looks like the documentation says to call RequestServerSideAccess
to get the authCode. Not sure why that string is passed at all.
To get the server side access code:
- Configure the web client id of the web application linked to your game in the Play Game Console.
- Call PlayGamesPlatform.Instance.RequestServerSideAccess once the player is authenticated to get the server side access code.
RequestServerSideAccess
was giving me an error until I used the client_id
with client_type: 3
. Obtained from google-services.json
from firebase. This is the web client id; the initial client id they give you is wrong.
This form is for reporting Unity Plugin issues only. To report an issue with the Play Games Service (non-SDK related), check Google Play Games Services Support. Once you've read this section and determined that your issue is appropriate for this repository, please delete this section.
Describe the bug On the response callback of Authentication method or Social.localUser.Authenticate method the second parameter (authcode) is "Success". Is not letting the token on that parameter.
To Reproduce Steps to reproduce the behavior:
PlayGamesPlatform.Instance.Authenticate(Social.localUser,async (success, authCode) => { Debug.Log("AUTHCODE: "+ authCode); });
Expected behavior Must return the authCode token to be able to execute
AuthenticationService.Instance.SignInWithGooglePlayGamesAsync(authCode)
Observed behavior Authcode is an string but with the "Success" value.
Versions