// Add the SignInWithApple button with your view and register the tap gesture
SignInWithApple()
.onTapGesture {
// Ideally this is called in a view model, but showcasing logic here for brevity
Task {
do {
// The `appUrlScheme` param is not necessary for using Sign in with Apple.
// Privy will use the first valid app URL scheme from your app's info.plist.
// Ensure your client's url schemes are registered in the Privy dashboard
let authSession = try await privy.oAuth.login(with: OAuthProvider.apple)
} catch {
debugPrint("Error: \(error)")
// Handle errors
}
}
}