Skip to main content
Version: 5.11.6

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);

Parameters

ValueTypeDescriptionDefault
identifierstringCertificates, Identifiers & Profiles page > Identifiers > Identifier created from Services IDs-
errorMessageout StringAn empty value for success / error information for failure-
leftintLeft margin px0
topintTop margin px0
rightintRight margin px0
bottomintBottom margin px0
callbackAppleLoginCallbackCallback methods called upon successful Apple login-

Attempts Apple login. The result can be checked through the callback event.
identifier has the value as shown below.

AppleLoginCallback

This is a handler that is called automatically when a token has been issued. It can be assigned as a variable for AppleLogin.

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

OnCloseButtonClick

This is a handler that is called when you quit Apple login with the button on the top right.

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

Example

    public void StartAppleLogin() {
#if UNITY_ANDROID || UNITY_EDITOR
TheBackend.ToolKit.AppleLogin.Android.OnCloseButtonClick = () => {
Debug.Log("The window has been closed");
};

TheBackend.ToolKit.AppleLogin.Android.AppleLogin("com.thebackend.testapp.applelogin", out var error, token => {
Debug.Log("Token : " + token);
Debug.Log("A token has been issued. You can now log in.");

Backend.BMember.AuthorizeFederation(token, FederationType.Apple, callback => {
Debug.Log("Apple login result : " + callback);
});
});

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

Error cases

(AuthorizeFederation method) When the entered identifier and the identifier value set from the console do not match
statusCode : 401
errorCode BadUnauthorizedException