Skip to content

Login with Apple

Privy supports native Apple login when running Unity on iOS.

Though Apple is an OAuth2.0 compliant authentication provider, it requires a specific implementation of Apple sign-in within iOS apps.

Setup

TIP

Prior to integrating Sign in with Apple, make sure your app's Bundle ID, rather than the Service ID, is configured as the Client ID within the Privy Dashboard.

Initializing the login flow

With Privy's SDK, you can use OAuthProvider.Apple just as any other OAuth provider.

csharp
try
{
    // User will be authenticated if this call is successful
    await PrivyManager.Instance.OAuth.LoginWithProvider(OAuthProvider.Apple, "myappscheme://");
}
catch
{
    // If "LoginWithProvider" throws an exception, user login was unsuccessful.
    Debug.Log("Error logging user in.");
}

Use the web based flow instead

Other platforms, such as Android, do not support native Apple sign-in. In these cases, the SDK will automatically fall back to a flow where the user signs in to Apple via a webview, as they do with other OAuth providers.