Hi support team,
Now I want to develop the function to login with google account. When an user clicks on the button "Login with Google" then the popup showing as below and user can choose the account to login. And it should work for both Android and IOS.
In Playfab, I am refering this tutorial: https://docs.microsoft.com/en-us/gaming/playfab/features/authentication/platform-specific-authentication/google-sign-in-unity
But I see that this is the login with Google Play Games and for only Android, not for Google account.
I also try the method as below:
private void GoogleLoginProcessing() { if (GoogleSignIn.Configuration == null) { //Setting GoogleSignIn.Configuration = new GoogleSignInConfiguration { RequestIdToken = true, RequestEmail = true, WebClientId = "....e8i7v7ggir.apps.googleusercontent.com" }; } Task<GoogleSignInUser> signIn = GoogleSignIn.DefaultInstance.SignIn(); signIn.ContinueWith(task => { if (task.IsCanceled == true) { Debug.LogError("Google log in task is canceled!"); Debug.LogError(task.Exception); } else if (task.IsFaulted == true) { Debug.LogError("Google log in task is faulted!"); Debug.LogError(task.Exception); } else { PlayfabManager.PlayFab.LoginWithGoogle(task.Result.IdToken, AfterLoginAction, errorCallbackGoogleLogin); } }); }
public void LoginWithGoogle(string googleAccessToken, Action<LoginResult> successCallback, Action<PlayFabError> errorCallback) { var request = new LoginWithGoogleAccountRequest() { TitleId = PlayFabSettings.TitleId, ServerAuthCode = googleAccessToken, CreateAccount = true, }; PlayFabClientAPI.LoginWithGoogleAccount(request, successCallback, errorCallback); }
But it has the error: InvalidGoogleToken = 1026. So could you tell me how to implement the Google Login (not Google Play Games) as above, and it should work for android and IOS?
Thank you so much!