Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void initialize()
- {
- UnityInitializer.AttachToGameObject(this.gameObject);
- credentials = new CognitoAWSCredentials(poolid, RegionEndpoint.APNortheast2);
- PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder()
- //.AddOauthScope("https://www.googleapis.com/auth/games")
- //.AddOauthScope("profile")
- .RequestIdToken()
- //.RequestServerAuthCode(false)
- .Build();
- PlayGamesPlatform.InitializeInstance(config);
- PlayGamesPlatform.DebugLogEnabled = true;
- PlayGamesPlatform.Activate();
- Social.localUser.Authenticate(GoogleLoginCallback);
- }
- void GoogleLoginCallback(bool success, string err)
- {
- if(success)
- {
- string token = PlayGamesPlatform.Instance.GetIdToken();
- //string token = ((PlayGamesLocalUser)Social.localUser).GetIdToken();
- //string token = PlayGamesPlatform.Instance.GetServerAuthCode();
- Debug.Log("Token = " + token);
- //credentials.AddLogin("accounts.google.com", token);
- }
- else
- {
- Debug.Log("에러 내용: " + err);
- Debug.LogError("Google login failed. If you are not running in an actual Android/iOS device, this is expected.");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement