GPGSV2로 로그인 기능을 구현했습니다. 로그인은 잘 진행이 되는데 뒤끝 서버에 로그인한 유저가 등록이 안되고 있습니다. 구글 플레이 콘솔에 테스터 계정으로도 등록이 되어 있는 계정입니다.
using BackEnd;
using GooglePlayGames;
using GooglePlayGames.BasicApi;
using UnityEngine;
public class GoogleLogin : MonoBehaviour
{
void Awake()
{
PlayGamesPlatform.DebugLogEnabled = true;
PlayGamesPlatform.Activate();
}
void Start() {
PlayGamesPlatform.Instance.Authenticate(ProcessAuthentication);
}
void ProcessAuthentication(SignInStatus status) {
if (status == SignInStatus.Success) {
GetAccessCode();
// Continue with Play Games Services
} else {
// Disable your integration with Play Games Services or show a login button
// to ask users to sign-in. Clicking it should call
// PlayGamesPlatform.Instance.ManuallyAuthenticate(ProcessAuthentication).
}
}
public void GetAccessCode()
{
PlayGamesPlatform.Instance.RequestServerSideAccess(
/* forceRefreshToken= */ false,
code => {
Debug.Log("구글 인증 코드 : " + code);
code = "4/0AeaYSHCuDcNr-Kai7Hx42BpreFACh3wLVEe5u7ZF-phOY8qv6lAHQ2R7a5Y3zWOqkfqocw";
Backend.BMember.GetGPGS2AccessToken(code, googleCallback =>
{
Debug.Log("GetGPGS2AccessToken 함수 호출 결과 " + googleCallback);
string accessToken = googleCallback.GetReturnValuetoJSON()["access_token"].ToString();
if (googleCallback.IsSuccess())
{
accessToken = googleCallback.GetReturnValuetoJSON()["access_token"].ToString();
}
Backend.BMember.AuthorizeFederation(accessToken, FederationType.GPGS2, callback =>
{
Debug.Log("뒤끝 로그인 성공했습니다. " + callback);
GameData.getInstance().LoadUserData();
});
});
});
}
}
이건 전체코드이고 아래는 로그캣으로 로그를 확인했을 때 나오는 오류 메세지 입니다.
GetGPGS2AccessToken 함수 호출 결과 StatusCode : 400
09-01 08:28:48.413 5710 5738 I Unity : ErrorCode : GoogleOAuthException
09-01 08:28:48.413 5710 5738 I Unity : Message : Object reference not set to an instance of an object.
09-01 08:28:48.413 5710 5738 I Unity : <>c:b__3_1(BackendReturnObject)
09-01 08:28:48.413 5710 5738 I Unity : or7e3bc9vuCj8lKipEw.d__8:MoveNext()
09-01 08:28:48.413 5710 5738 I Unity : UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
09-01 08:28:48.413 5710 5738 I Unity :
09-01 08:28:48.429 5710 5738 E Unity : NullReferenceException: Object reference not set to an instance of an object.
- 뒤끝 SDK 버전 : 5.18.1
- 프로젝트명 : ZombieAlive
- 스테이터스 코드 :
- 에러 코드 :
- 에러 메시지 :