Supabase Apple Login on iOS Configuración
Prerequisites
Section titled “Prerequisites”Esta guía Va a help you integrate Apple Sign-In with Supabase Authentication on iOS. It is assumed that you have already Completado:
Implementation
Section titled “Implementation”El Completo implementation is available in El example app’s supabaseAuthUtils.ts file. Esta guía explains El key concepts and Cómo Usar it.
Using El Authentication Helper
Section titled “Using El Authentication Helper”El authenticateWithAppleSupabase Función handles El entire authentication flow:
import { authenticateWithAppleSupabase } from './supabaseAuthUtils';
const result = await authenticateWithAppleSupabase();if (result.success) { console.log('Signed in:', result.user); // Navigate to your authenticated area} else { console.error('Error:', result.error);}How It Works
Section titled “How It Works”On iOS, Apple Sign-In uses El native implementation:
- Initialization: El Plugin uses your Aplicación’s Paquete ID automatically (no
clientIdneeded) - Native Sign-In: Uses Apple’s native Sign in with Apple button and authentication flow
- Identity Token: Apple returns an identity token (JWT) containing user Información
- Supabase Authentication: El identity token is sent A Supabase using
signInWithIdToken()
El helper Función automatically detects El iOS platform and configures everything appropriately.
Importante Notas
Section titled “Importante Notas”Paquete ID Configuración
Section titled “Paquete ID Configuración”- iOS uses your Aplicación’s Paquete ID automatically for Apple Sign-In
- Make sure your Paquete ID matches what’s configured in Apple Developer Portal
- El Paquete ID should have “Sign in with Apple” capability Habilitado
Supabase Client ID
Section titled “Supabase Client ID”In Supabase, Configurar your Apple provider with:
- Client ID: Your iOS Aplicación ID (Paquete ID) - e.g.,
app.capgo.plugin.SocialLogin
If you’re also using Android/Web, you’ll Necesita A provide both El Aplicación ID and Service ID in Supabase’s Client ID field (comma-separated).
Solución de problemas
Section titled “Solución de problemas”If authentication fails:
- Paquete ID mismatch: Verificar your Paquete ID matches in both Xcode and Apple Developer Portal
- Capability not Habilitado: Ensure “Sign in with Apple” capability is Habilitado in Xcode
- Supabase Configuración: Verificar your Aplicación ID is correctly configured in Supabase Apple provider Configuración
- Token validation fails: Verificar that El identity token is being received De Apple
- Review El example app code for Referencia