feat: Implement Apple Sign-In for Android by adding a callback function, updating redirect URI, and configuring the Android manifest.

This commit is contained in:
Van Leemput Dayron
2025-12-03 15:41:22 +01:00
parent f3ae91ccf9
commit fd19b88eef
4 changed files with 50 additions and 14 deletions

View File

@@ -58,6 +58,9 @@ class _LoadingContentState extends State<LoadingContent>
}
} catch (e) {
debugPrint('Erreur lors de la tâche en arrière-plan: $e');
if (mounted) {
Navigator.pop(context);
}
}
}
}

View File

@@ -225,20 +225,20 @@ class AuthService {
}
// Request Apple ID credential with platform-specific configuration
final AuthorizationCredentialAppleID credential =
await SignInWithApple.getAppleIDCredential(
scopes: [
AppleIDAuthorizationScopes.email,
AppleIDAuthorizationScopes.fullName,
],
// Configuration for Android/Web
webAuthenticationOptions: WebAuthenticationOptions(
clientId: 'be.devdayronvl.travel_mate.service',
redirectUri: Uri.parse(
'https://travelmate-a47f5.firebaseapp.com/__/auth/handler',
),
),
);
final AuthorizationCredentialAppleID
credential = await SignInWithApple.getAppleIDCredential(
scopes: [
AppleIDAuthorizationScopes.email,
AppleIDAuthorizationScopes.fullName,
],
// Configuration for Android/Web
webAuthenticationOptions: WebAuthenticationOptions(
clientId: 'be.devdayronvl.TravelMate.service',
redirectUri: Uri.parse(
'https://us-central1-travelmate-a47f5.cloudfunctions.net/callbacks_signInWithApple',
),
),
);
// Create OAuth credential for Firebase
final OAuthCredential oauthCredential = OAuthProvider("apple.com")