Table of Contents

Class AppleIdSignInManager

Class to handle AppleID account sign-in.

public class AppleIdSignInManager : DontCreateNewSingleton<AppleIdSignInManager>
Inheritance
object
AppleIdSignInManager

Fields

OnGotCredentialState

Called when the credential state checking operation completes, with the state and any error that occurred.

public UnityEvent<AppleIdCredentialState, string?> OnGotCredentialState

Field Value

UnityEvent<AppleIdCredentialState, string>

OnSignInFailed

Called when the sign-in flow fails, with the failure reason.

public UnityEvent<AppleIdSignInErrorCode> OnSignInFailed

Field Value

UnityEvent<AppleIdSignInErrorCode>

OnSignedIn

Called when the sign-in flow succeeds, with the AppleID credential.

public UnityEvent<AppleIdCredential> OnSignedIn

Field Value

UnityEvent<AppleIdCredential>

Methods

Awake()

protected override void Awake()

GetCredentialState(string)

Returns the credential state for the given user in OnGotCredentialState.

public void GetCredentialState(string userId)

Parameters

userId string

An opaque string associated with the Apple ID that your app receives in the credential’s user property after performing a successful authentication request.

GetCredentialStateAsync(string, CancellationToken)

Returns the credential state for the given user.

public Awaitable<(AppleIdCredentialState state, string? errorDescription)> GetCredentialStateAsync(string userId, CancellationToken token = default)

Parameters

userId string

An opaque string associated with the Apple ID that your app receives in the credential’s user property after performing a successful authentication request.

token CancellationToken

Returns

Awaitable<(AppleIdCredentialState state, string errorDescription)>

The state and any error that occurred.

ReadNameComponentsToManagedType(ref NativePersonNameComponents?)

Reads a NativePersonNameComponents object into an instance of PersonNameComponents.

protected static PersonNameComponents? ReadNameComponentsToManagedType(ref NativePersonNameComponents? nativeComponents)

Parameters

nativeComponents NativePersonNameComponents?

The native object to read.

Returns

PersonNameComponents

The managed object or null if nativeComponents is null.

Remarks

While this method DOES NOT dispose of nativeComponents, it does dispose of its PhoneticRepresentation.

SignIn(AppleIdScope, string?, string?)

Starts the AppleID Sign-In flow.

public void SignIn(AppleIdScope requestedScopes, string? nonce = null, string? state = null)

Parameters

requestedScopes AppleIdScope

The kinds of contact information that can be requested from the user.

nonce string

A string value to pass to the identity provider.

state string

Data that's returned to you unmodified in the corresponding credential after a successful authentication.

SignInAsync(AppleIdScope, string?, string?, CancellationToken)

Starts the AppleID Sign-In flow.

public Awaitable<(AppleIdCredential?, AppleIdSignInErrorCode)> SignInAsync(AppleIdScope requestedScopes, string? nonce = null, string? state = null, CancellationToken token = default)

Parameters

requestedScopes AppleIdScope

The kinds of contact information that can be requested from the user.

nonce string

A string value to pass to the identity provider.

state string

Data that's returned to you unmodified in the corresponding credential after a successful authentication.

token CancellationToken

Returns

Awaitable<(AppleIdCredential, AppleIdSignInErrorCode)>

The AppleID credential or the failure reason.