본문으로 건너뛰기
버전: 5.11.2

GoogleLogin

public bool GoogleLogin(string webClientId, out string errorMessage);

파라미터

ValueTypeDescription
webClientIdstring구글 클라우드 플랫폼에서 설정한 웹 ClientID
errorMessageString성공 시, 빈 값 / 실패 시, 에러정보

구글 로그인을 시도합니다. 결과는 OnGoogleLogin 콜백 이벤트을 통해 확인할 수 있습니다.

Example

public void StartGoogleLogin()
{
#if UNITY_ANDROID
string message;
var result = BackendFederation.Android.GoogleLogin("123456789-abcdefghigkelnop12351.apps.googleusercontent.com", out message);
if (result == false)
{
Debug.LogError(message);
}
#endif
}

ReturnCase

Success cases

구글 로그인 호출에 성공한 경우
이 상태는 단순히 구글 로그인에 성공한 것이 아니며 onGetAccessToken의 결과값을 통해 로그인의 성공 여부를 확인할 수 있습니다.
true
errorInfo : ErrorInfo.Success

Error cases

실행 기기가 Android가 아닐 경우
false
errorMessage : "not support os: [ platform ]"