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

GoogleLogin

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

파라미터

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

설명

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

Example

void StartLogin()
{
#if UNITY_IOS
string message;
var result = BackendFederation.iOS.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

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