IosAppleSignIn

class IosAppleSignIn(anchor: () -> UIWindow, nonceSource: () -> String = { newRawNonce() }) : SocialSignIn(source)

Sign in with Apple on iOS, natively — no Services ID, no redirect URI, no server bounce. The App ID's Sign In with Apple capability and the matching entitlement are the whole configuration, which is why none of the __PROVISION_APPLE_*__ values appear on this side. (Your server still needs them to exchange or revoke the code; see AppleSiwaServer.)

Parameters

anchor

the window to present over. Required, not defaulted: every way of finding the key window from a library (UIApplication.keyWindow, .windows) is deprecated and wrong in a multi-scene app. The host has the window; the host passes it.

The weak-delegate trap

ASAuthorizationController holds delegate and presentationContextProvider weakly. A delegate allocated inside a suspend fun has no other owner, so ARC frees it the moment the function suspends — the sheet stays on screen, no callback ever fires, and the coroutine hangs forever with no error to log. inFlight and inFlightController are the strong references that stop that, and they are cleared only once the flow has actually ended. This is the same hazard as PKPaymentAuthorizationController; it is a property of the delegate pattern, not of one API.

Constructors

Link copied to clipboard
constructor(anchor: () -> UIWindow, nonceSource: () -> String = { newRawNonce() })

Properties

Link copied to clipboard
open override val provider: AuthProvider

Functions

Link copied to clipboard
open override fun availability(): SignInAvailability

Always SignInAvailability.AVAILABLE on a supported deployment target. A missing entitlement cannot be detected before presenting — it surfaces as an error from the sheet, and comes back as SignInOutcome.Failed. Nothing here is provisioning-gated, so there is no SignInAvailability.NOT_CONFIGURED state to reach.

Link copied to clipboard
open suspend override fun signIn(): SignInOutcome

Presents the provider's UI and suspends until the user finishes, cancels, or it fails.