Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
1.2 kB
4
Indexable
Never
        public void GoogleSignIn()
        {
            PlayGamesPlatform.Instance.Authenticate(ProcessAuthentication);
    
        }
    
        private void ProcessAuthentication(SignInStatus status)
        {
            if (status == SignInStatus.Success)
            {
                
                Debug.Log(PlayGamesPlatform.Instance.GetUserDisplayName());
                PlayGamesPlatform.Instance.RequestServerSideAccess(false, code =>
                {
                    LoginWithGooglePlayGamesServicesRequest googlerequset = new LoginWithGooglePlayGamesServicesRequest
                    {
                        CreateAccount = true,
                        ServerAuthCode = code,
                        TitleId = "77769"
                    };
                    PlayFabClientAPI.LoginWithGooglePlayGamesServices(googlerequset, result => { Debug.Log("All Good" + ((PlayGamesLocalUser)Social.localUser).id);}, Error => { Debug.Log("error"); });
                });
    
            }
            else
            {
               PlayGamesPlatform.Instance.ManuallyAuthenticate(ProcessAuthentication);
            }
        }