본문으로 건너뛰기
버전: SDK-5.11.7

AppleLogin

public bool AppleLogin(string webClientId, out string errorMessage, AppleLoginCallback callback);
public bool AppleLogin(string webClientId, out string errorMessage, int left, int top, int right, int bottom, AppleLoginCallback callback);

파라미터

ValueTypeDescriptionDefault
identifierstringCertificates, Identifiers & Profiles 페이지 > Identifiers > Services IDs에서 생성한 Identifier-
errorMessageout String성공 시, 빈 값 / 실패 시, 에러정보-
leftint왼쪽 여백 px0
topint위쪽 여백 px0
rightint오른쪽 여백 px0
bottomint아래쪽 여백 px0
callbackAppleLoginCallback애플 로그인 성공 시 호출되는 콜백 함수-

애플 로그인을 시도합니다. 결과는 콜백 이벤트를 통해 확인할 수 있습니다.
identifier은 아래와 같은 값입니다.

AppleLoginCallback

토큰이 발급되었을 경우, 자동으로 호출되는 핸들러입니다. AppleLogin의 변수로 할당 가능합니다.

public delegate void AppleLoginCallback(string token);
private static AppleLoginCallback OnAppleLogin;

OnCloseButtonClick

애플 로그인을 우측 상단에 버튼으로 종료하였을 경우, 호출되는 핸들러입니다.

public delegate void CloseButtonClickCallback();
public static CloseButtonClickCallback OnCloseButtonClick;

Example

    public void StartAppleLogin() {
#if UNITY_ANDROID || UNITY_EDITOR
TheBackend.ToolKit.AppleLogin.Android.OnCloseButtonClick = () => {
Debug.Log("창이 닫혔습니다");
};

TheBackend.ToolKit.AppleLogin.Android.AppleLogin("com.thebackend.testapp.applelogin", out var error, token => {
Debug.Log("토큰 : " + token);
Debug.Log("토큰 발급이 완료되었습니다. 로그인이 가능합니다.");

Backend.BMember.AuthorizeFederation(token, FederationType.Apple, callback => {
Debug.Log("애플 로그인 결과 : " + callback);
});
});

if (string.IsNullOrEmpty(error) == false) {
Debug.Log("에러 : " + error);
}
#endif
}

error cases

(AuthorizeFederation함수) 입력한 identifier와 콘솔에서 설정한 identifier의 값이 올바르지 않는 경우
statusCode : 401
errorCode BadUnauthorizedException
message bad bad appId, 잘못된 bad appId입니다